[R] how to remove ( ) ? when using write.csv(chron.object)

2009-05-04 Thread Qianfeng Li
Hello all,

I don' like to have ( ) around my datetime, when send the csv file to somebody. 

How to remove it?

library(chron)
mydate - c(2009-05-03,2009-06-07)
mytime - c(10:30:00,10:20:00)
mydatetime - chron(dates=mydate,times=mytime,format=c(y-m-d,h:m:s))
write.csv(mydatetime)
 
,x
1,(09-05-03 10:30:00)
2,(09-06-07 10:20:00)
 
thanks!
Jeff 


  
[[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] How to use write.csv(x=zoo.object), and how to let the first column corret?

2009-05-01 Thread Qianfeng Li
Use  write.csv to output a zoo object, and found the first column in excel 
like:  (08-10-16 13:12:00)
 
How to make it look like : 10/16/2008 13:12:00 ? 
 
 
write.csv(x=zoo.object)
 
Thanks!


  
[[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] how to input multiple .txt files

2009-03-29 Thread Qianfeng Li


how to input multiple .txt files? 

A data folder has lots of .txt files from different customers. 

Want to read all these .txt files to different master files: 

such as: 

 cust1.xx.txt,  cust1.xxx.txt, cust1..txt,.. to master file: 
X.txt

 cust2.xx.txt,  cust2.xxx.txt, cust2..txt,.. to master file: 
Y.txt


Thanks!


  
[[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] How to: Read Multi-filtes and sort to different files

2009-03-25 Thread Qianfeng Li
new R user has a question: 

I have several hundreds of .txt files from  different monitoring sites over 
several years. 
(1) different site has a unique name( such as : ST2.20090321.txt = Sation 2  
2009 March 21 data, ST3.20090322=Station3, 2009, March 22 data). 
(2) different site has different file header, but for the same site, the header 
is the same.
for example: 
Sation 2 
date time wind CO2 
2009 10:30 2 3 
station 3
data time solar NO
2009 10:20 4 5

Question: 
How to write a R program to read all these files, and combine the data from 
each station to one file (such as: ST2.master will save all the data from 
station 2, and ST1.master will save all the data from station 1) ? 


Thanks a million times!

Jeff 


  
[[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] Looking for program for sample size determination

2009-03-21 Thread Qianfeng Li
we have some initial data from our field sampling. From the means and 
variances, we see your sampling field is much heterogeneous (not uniform). 

We are looking for a R program for sampling size determination.

 Right now, we are not good enough to write a whole R program, so please 
help. 


  
[[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] How to monthly,daily,yearly average

2009-03-11 Thread Qianfeng Li
Sorry, this is my first time to post. 

I have a big data set: first colume is date (ex: 2008-2-150, the second is time 
(10:30:00), and the following columes are variaty measurement data. Every 30 
min, I have one data. 

I want to find an effecient way to calculate the hourly, daily, monthly and 
yearly average, and plot them, and eventually use these average data to do 
further analysis. 

Thanks!
Jeff  


  
[[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.