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