[R] solution design for a large scale ( 50G) R computing problem

2009-11-07 Thread jeffc
Hi, I am tackling a computing problem in R that involves large data. Both time and memory issues need to be seriously considered. Below is the problem description and my tentative approach. I would appreciate if any one can share thoughts on how to solve this problem more efficiently. I have

[R] save an object by dynamicly created name

2009-11-01 Thread jeffc
Hi, I would like to save a few dynamically created objects to disk. The following is the basic flow of the code segment for(i = 1:10) { m = i:5 save(m, file = ...) ## ??? } To distinguish different objects to be saved, I would like to save m as m1, m2, m3 ..., to file /home/data/m1,

[R] how to replace NA with previous numbers

2008-11-19 Thread jeffc
Hi, I have a vector with lots of NAs. e.g. vec = c(NA, NA, 2, NA, NA, 5, NA, 6, NA) vec [1] NA NA 2 NA NA 5 NA 6 NA I would like to replace NAs with their immediately previous non NA number. After replacement, the above vector will become vec [1] 0 0 2 2 2 5 5 6 6. I understand how to

Re: [R] how to calculate another vector based on the data from a combination of two factors

2008-11-17 Thread jeffc
Hi All, Thank all for the input. These different solutions rock!. Hao -- View this message in context: http://www.nabble.com/how-to-calculate-another-vector-based-on-the-data-from-a-combination-of-two-factors-tp20532749p20553226.html Sent from the R help mailing list archive at Nabble.com.

[R] how to calculate another vector based on the data from a combination of two factors

2008-11-16 Thread jeffc
Hi, I have a data set similar to the following State Gender Quantity TX Male1 NY Female 2 TX Male3 NY Female 4 I need to calculate cumulative sum of the quantity by State and Gender. The expected output is State Gender QuantityCumQuantity TX