Skip to content
Prev 345882 / 398503 Next

Saving Google worksheets with common prefix

I got it!


for (i in sheetz$names) {
print(i)
file.name <- paste(i, " - ", Sys.Date(), ".csv", sep="")
print(file.name)
#traceback()
i <- sheetAsMatrix(ts[[i]], header = TRUE, as.data.frame = TRUE, trim =
TRUE)
write.csv(i, file.name)
i
}

I have to use ts[[i]] rather than ts$i (or ts2, either)

Thanks!

Jen

PS - if anyone wants to use that code and that dummy gmail account to play
around with R, that's fine - be my guest.  The email address is hidden but
it's "r dot project dot user at gmail dot com" and the password is in the
code.  Upload your own data and play, if you like.




On Fri, Nov 21, 2014 at 11:02 AM, Jennifer Sabatier <
plessthanpointohfive at gmail.com> wrote: