Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IronistM/7705533 to your computer and use it in GitHub Desktop.
Save IronistM/7705533 to your computer and use it in GitHub Desktop.
save an R dataframe with the name specified by a string
# Create explicit data frames and TS objects given a list
market.list<- c("GR","CY","RU","RO","PL","UA","ROW")
for (i in market.list) {
tmp <- subset(data,Market==i)
tmp<-ts(tmp) # It's a timeseries afterall...
# Let's save the data somewhere so we don't get back all the time
filename <- paste("data_", i, sep="")
assign(filename, tmp)
save(filename, file=paste(filename, ".rda",sep=""))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment