Re: [R] Newbie's question

From: Sarah Goslee <>
Date: Sun, 13 May 2007 09:09:48 -0400

Sure, R can do anything. The first trick, though, is to learn how to write clear-enough questions to the mailing list that you get helpful answers back. A worked example of what you want would be very useful, since I have no idea what the index is, or what field2 is, or what kind of graph you want. OS would also be helpful, since the example I'm giving only works as written on linux.

Still, one approach

allfiles <- system("ls *.csv", intern=TRUE) # linux only allfield2 <- numeric(length(allfiles))
for(i in 1:length(allfiles)) {

   allfield2 <- read.table(allfiles[i])$field2   # need read.table options, and correct way to get field2 }

hist(allfield2); sd(allfield2)


On 5/12/07, onthetopo <> wrote:
> Hi guys,
> I've brand new to the R scene.
> I have hundreds of csv files that has field 1 ,YYYY/MM/DD as index
> How to generate a graph of distribution and calculate the standard deviation
> of field2 for all of the files in a directory?
> I'm wondering if R could do this.
> Thanks a lot.

Sarah Goslee

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 13 May 2007 - 13:12:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 May 2007 - 14:31:04 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.