I have 100 data set in *.csv format with the same name but different indexes: myarray1, myarray2,..., myarray100. I have written a function to read these data sets and do some stuff but I don't want to run the function 100 times. This is the main part of function:
Myfunc <- function(file){
setwd("C:\\Users\\Desktop\\mydaya")
data.temp1 <- read.csv("C:\\Users\\Desktop\\mydata\\myarray1.csv",header=FALSE)
.......
#core of function
.....
}
is it possible to write a for-loop somehow that runs the function itself 100 times and also change the index of "myarray..." in third command line inside the function at the same time: for example myarray1 in
data.temp <- read.csv("C:\\Users\\Desktop\\mydata\\myarray1.csv",header=FALSE)
becomes myarray2 in second run of the function and so on up to 100 times.