Re: [R] paste0 in file path

2016-08-31 Thread Bob Rudis
if the files are supposed to be "1r.xlsx", "2r.xlsx" (etc) then you need to ensure there's a "/" before it. It's better to use `file.path()` to, well, build file paths since it will help account for differences between directory separators on the various operating systems out there. On Wed, Aug 3

Re: [R] paste0 in file path

2016-08-31 Thread Henrik Bengtsson
Also, the recommended way to build file paths is to use file.path(), i.e. file.path("C:", "temp", filename) rather than paste0("C:/temp/", filename) BTW, R provides tempdir() that gives you the temporary directory that R prefers to use on your OS. So, you might want to consider using:

Re: [R] paste0 in file path

2016-08-31 Thread Uwe Ligges
On 31.08.2016 17:50, Leslie Rutkowski wrote: Hi, I'm trying to reshape and output 8 simple tables into excel files. This is the code I'm using for (i in 1:8) { count <- table(mydata$ctry, mydata[,paste0("q0",i,"r")]) dat <- as.data.frame(q01count) wide <- reshape(dat,

[R] paste0 in file path

2016-08-31 Thread Leslie Rutkowski
Hi, I'm trying to reshape and output 8 simple tables into excel files. This is the code I'm using for (i in 1:8) { count <- table(mydata$ctry, mydata[,paste0("q0",i,"r")]) dat <- as.data.frame(q01count) wide <- reshape(dat, timevar="Var2", idvar="Var1"