Re: [R] Two quick questions

2006-03-03 Thread ronggui
The second question: STATA: use auto collapse (sum) price mpg,by( make foreign) R: if you have the same data set named auto in R whatyouwant - aggregate(auto[,c(mpg,price)],by=auto[,c(make,foreign)],FUN=sum) 2006/3/3, Serguei Kaniovski [EMAIL PROTECTED]: Hi all, 1. How to construct a

Re: [R] Two quick questions

2006-03-03 Thread Jacques VESLOT
DF$date - as.Date(paste(DF$day,DF$month,DF$year), %d %m %Y) # if 4-figure year aggregate(DF[c(var1, var2, var3)], DF[c(date, sector)], sum, is.na=T) Serguei Kaniovski a écrit : Hi all, 1. How to construct a date from three variables year, month, and day, where all three are integers? 2. I

[R] Two quick questions

2006-03-02 Thread Serguei Kaniovski
Hi all, 1. How to construct a date from three variables year, month, and day, where all three are integers? 2. I have a dataframe by date and sector. I would like to add-up all entries for all variable with identical date and sector, replacing the original entries, i.e. emulate the STATA command

Re: [R] Two quick questions

2006-03-02 Thread Prof Brian Ripley
On Fri, 3 Mar 2006, Serguei Kaniovski wrote: Hi all, 1. How to construct a date from three variables year, month, and day, where all three are integers? ?ISOdate (and perhaps use as.Date on the result) 2. I have a dataframe by date and sector. I would like to add-up all entries for all