Thanks a lot!
On Fri, Dec 5, 2008 at 5:54 PM, Gabor Grothendieck
[EMAIL PROTECTED] wrote:
Try this:
dir()[!file.info(dir())$isdir]
On Fri, Dec 5, 2008 at 2:30 PM, Gustavo Carvalho
[EMAIL PROTECTED] wrote:
Is there a way to list only the files in a given directory without
passing
Hi,
I have about 900 files that I need to run the same R script on. I
looked over the R Data Import/Export Manual and couldn't come up with
a way to read in a sequence of files.
The files all have unique names and are in the same directory. What I
want to do is:
1) Create a list of
Have you thought about using one of the Python/R interface modules?
http://www.omegahat.org/RSPython/
http://rpy.sourceforge.net/
Admittedly, I have not had much success in getting these to work on my
machine, but I know others who have.
Kyle H. Ambert
Graduate Student
Department of Medical
This is almost a macro problem. It could be done in SAS language using the
WPS product (660 USD) I think.
It is a familiar problem and I would be quite interested in the result.
Is there any concept of Macros in R or a package to do the same.
Regards,
Ajay
On Fri, Dec 5, 2008 at 11:31 PM,
2008/12/5 Chris Poliquin [EMAIL PROTECTED]:
Hi,
I have about 900 files that I need to run the same R script on. I looked
over the R Data Import/Export Manual and couldn't come up with a way to
read in a sequence of files.
The files all have unique names and are in the same directory.
Gunter
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Chris Poliquin
Sent: Friday, December 05, 2008 10:02 AM
To: r-help@r-project.org
Subject: [R] Running R Script on a Sequence of Files
Hi,
I have about 900 files that I need to run the same R script
Thanks, Barry. I'll use that in the future.
---Kyle.
On Fri, Dec 5, 2008 at 11:01 AM, Barry Rowlingson
[EMAIL PROTECTED] wrote:
2008/12/5 Chris Poliquin [EMAIL PROTECTED]:
Hi,
I have about 900 files that I need to run the same R script on. I looked
over the R Data Import/Export
Use dir to get the names and then lapply over them with a
custom anonymous function where L is a list of the returned
values:
# assumes file names are those in
# current directory that end in .dat
filenames - dir(pattern = \\.dat$)
L - lapply(filenames, function(x) {
DF - read.table(x,
I can't believe the two 'solutions' already posted. It's easy:
Me neither.
?list.files
That's what I would use, too. If the OP is on a UNIX platform,
run the R-script in a loop in the shell is an alternative.
Something like this (bourne shell syntax):
for datafile in *.csv ; do
Is there a way to list only the files in a given directory without
passing pattern=... to list.files()?
On Fri, Dec 5, 2008 at 5:10 PM, Kyle. [EMAIL PROTECTED] wrote:
Thanks, Barry. I'll use that in the future.
---Kyle.
On Fri, Dec 5, 2008 at 11:01 AM, Barry Rowlingson
[EMAIL PROTECTED]
Try this:
dir()[!file.info(dir())$isdir]
On Fri, Dec 5, 2008 at 2:30 PM, Gustavo Carvalho
[EMAIL PROTECTED] wrote:
Is there a way to list only the files in a given directory without
passing pattern=... to list.files()?
On Fri, Dec 5, 2008 at 5:10 PM, Kyle. [EMAIL PROTECTED] wrote:
Thanks,
always keep possession of the ball ... :-)
Cheers,
Jagat
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ajay ohri
Sent: Friday, December 05, 2008 12:59 PM
To: Chris Poliquin
Cc: r-help@r-project.org
Subject: Re: [R] Running R Script on a Sequence of Files
] [mailto:[EMAIL PROTECTED]
On Behalf Of Ajay ohri
Sent: Friday, December 05, 2008 12:59 PM
To: Chris Poliquin
Cc: r-help@r-project.org
Subject: Re: [R] Running R Script on a Sequence of Files
This is almost a macro problem. It could be done in SAS language using
the
WPS product (660 USD) I
It seems that you have 900 files with the same parameters in each file (I
might be reading more between the lines here than you inferred). However if
this is the case, why not import each of the files into a common database
and then link the database using ODBC connectivity options. If that is
14 matches
Mail list logo