Dear R helpers
Â
I have some files in my say 'WORK' directory and the file names are say
rate1.csv, rate2.csv, rate3.csv, rate4.csv
Â
Because of some other requirement, I need to run the following commands
Â
n = 4Â
Â
rates = NULL
Â
for (i in 1:n)
rates[i] = (paste(`rate', i, â.csv`, sep = ââ))
Â
# this gives me "rate1.csv" "rate2.csv" and so on
Â
#My problem is now I need to relate these file names with actual files and read
these files
# There are files rate1.csv, rate2.csv, rate3.csv, rate4.csv in my WORK
directory.
Â
Â
# If I individually define
Â
PPP = read.csv(ârate[1]â)
PPPÂ Â Â Â Â # When I run PPP in R, it gives contents of the file rate1.csv
i.e. I am able to read the required rate1 file. But if I run following
commands, I get errors.
Â
newrate = NULL
Â
for (i in 1:n)
  {
   newrate[i] = read.csv(rates[i])
  }
Â
I need to read all these four files for my further analysis. Please guide.
Â
Â
Regards
Â
Maithili
Â
Â
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
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.