[R] generate multipe output .csv files in a loop

2009-04-22 Thread Gator Connection


I need to generate output files as .csv file in a loop:

let's say, I want to generate a sequence of files according to the loop number 
"i".

the first file genearted should be file1.csv

the second should be file2.csv

I use:
write.csv(temp, "file$i$.csv") in the loop but it did not work.

can anyone give suggestions?

thanks a lot.

Jack

_
Rediscover HotmailĀ®: Get e-mail storage that grows with you. 

Storage2_042009
[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] help on establishing a matrix

2008-01-30 Thread Gator Connection

I am a beginner and this is a naive question.
I have the following data set.
row column height
1 2 96
3 7 67
9 25 77
..
I have a matrix of 50*100 data points and about 60% of them are zeros.
I want to put the height data into the matrix according to their row and column 
numbers. does anybody have experience in setting up such matrix? 
Your help is highly appreciated.
Jack
LSU
_
[[elided Hotmail spam]]

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] FW: merge multiple csv files

2008-02-08 Thread Gator Connection





Dear list:I have a folder that contains more than 50 csv files labels 
sequencially like sample01.csv to sample50.csv. for each file the first 5 rows 
are descriptive of the data collected (useful but not needed in data merge). 
each file then start the data at row 6 and have 2 variables x and y. In order 
to know which file one observation is from, I'd like to have a new variable 
location, for example if the data are from file sample11.csv, then the location 
for that obs is 11.Another difficulty is there might be two observations 
actually repetitive, for example sample05.csv might contain (4, 10) and (4, 
12). I'd like to average it into (4, 11).  Any suggestions are welcome.Jack 

Connect and share in new ways with Windows Live. Get it now! 
_


08
[[alternative HTML version deleted]]

__
R-help@r-project.org 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.