Pablo Freudenthal
Pablo Freudenthal

Reputation: 1

How to write unique CSV file names in R

I conducted 12 different experiments and I want to apply a script to each csv file in the folder. The csv files in the folder have names like emo_1, emo_2. etcetera

After conducting analysis, joining with other files of type route_1, route_2...etc

I wish to write.csv and assign unique names, so I get unique files in my directory of type emoroute_1, emoroute_2

Thanks for your suggestions!

Upvotes: 0

Views: 212

Answers (1)

sdgfsdh
sdgfsdh

Reputation: 37045

If you have samples 1 to n, just do:

fileNames <- paste0("emoroute_", 1:n)

Upvotes: 1

Related Questions