Have you considered importing in a loop, something like the following:
for(i in 1:length(files)){
df.i <- read.table(files[i])
print(summary(df.i))
}
To make this work, you need to know that read.table works fine on all
"files". I would do it in two steps, reading "files" into objects whose
names are stored in a character vector "dfs". Then I'd try something
like the following:
for(i in 1:length(dfs))
print(summary(get(dfs[i])))
Hope this helps.
Spencer Graves
ming hsu wrote:
Hi, this is kind of a silly syntax question, but I wasn't able to find
the answer in the manual. I have a series of linear models that I wish
to creat a summary table for. I tried to loop over the names with the
following command
for ( i in 1:Length(files) )
summary(files[i])
The problem is that SPlus takes files[i] as a string literal instead of
a file name. How do I get around that?
Sincerely,
Ming Hsu
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
|