3
I have a list of files, example 001.R
and 002.R
. Usually I do:
for (i in c('001.R' e '002.R')){source(i)}
However, there is now a parameter within each file that I need to change. No 001.R
and 002.R
is written:
x<-1:10
if(M==TRUE){write.csv(x, file = "foo.csv")}
Then how to set the value of M (TRUE
or FALSE
) before entering the for
?
Although it is possible to do this, I believe that the most recommended is to turn these scripts into functions and add an argument to the function. Case
– Tomás Barcellos