Try for (ind in 1:24) { data = read.csv(paste0("data", ind, ".csv")) ... }
Peter On Mon, Feb 19, 2024 at 11:33 AM Steven Yen <st...@ntu.edu.tw> wrote: > > I need to read csv files repeatedly, named data1.csv, data2.csv,… data24.csv, > 24 altogether. That is, > > data<-read.csv(“data1.csv”) > … > data<-read.csv(“data24.csv”) > … > > Is there a way to do this in a loop? Thank you. > > Steven from iPhone > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.