Re: [R] A simple For-Loop doesn't work

2015-03-15 Thread Berend Hasselman
> On 14-03-2015, at 18:28, Nicolae Doban wrote: > > Hello, > > my name is Nick and I'm working on a project. I'm having trouble with > building a simple for-loop. In this loop I want to read csv files, perform > a corr function and save it to a pdf file. I tried to solve this problem by > looki

Re: [R] A simple For-Loop doesn't work

2015-03-15 Thread Rainer Schuermann
Hi Nick, Your code is not exactly "commented, minimal, self-contained, reproducible" and contains a number of inconsistencies (Data has three elements, your loop expects six). Try something like Data <- c("July", "August", "September") ... for( x in Data ) { currentData <- read.csv( pa

Re: [R] A simple For-Loop doesn't work

2015-03-15 Thread Sergio Fonda
Pay attention to the i counter in the loop: it runs from 1 to 6 but data has only 3 elements Il 15/mar/2015 04:56 "Nicolae Doban" ha scritto: > Hello, > > my name is Nick and I'm working on a project. I'm having trouble with > building a simple for-loop. In this loop I want to read csv files, pe

[R] A simple For-Loop doesn't work

2015-03-14 Thread Nicolae Doban
Hello, my name is Nick and I'm working on a project. I'm having trouble with building a simple for-loop. In this loop I want to read csv files, perform a corr function and save it to a pdf file. I tried to solve this problem by looking for solutions online but couldn't figure it out. Could you als