Sam
Sam

Reputation: 25

how do you set the name of the file as data from a variable (in R)?

how do you set the name of the file as data from a variable? e.g. creating the file in a for loop (so it wouldn't be overwritten when the next file is created with new data)

for example:

Upvotes: 1

Views: 33

Answers (1)

TheN
TheN

Reputation: 513

For the parameter in write.table, do this

file = paste0("C:\\Users\\my-PC\\Dropbox\\Data mining\\", instruments, ".csv")

Upvotes: 2

Related Questions