Hi,
I hope somebody could help me explain what seems
mysterious to me?
I use this line on a dataframe ae:
summaryBy(total_inflated+total~gr1, data=ae, FUN=sum,
na.rm=T)
and it returns 3 columns as expected and columns "gr1"
and "total_inflated.sum"are correct but the
"total.sum" column consists of only zeros which is not
correct. The same happens when I rename the
"total_inflated" to "total.inflated" or
"totalinflated" but not when I rename it to
"ttotal_inflated". In the latter case I get the
correct result also for the "total.sum" column.
Could anyone explain the rules for the column naming
to me?
Thank you very much in advance!
Werner
Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:
Sorry that the problem description was not sufficient.
Here is a self-contained code replicating the problem:
require(doBy)
x <-
as.data.frame(matrix(ncol=3,seq(1,12),dimnames=list(c(),c("hh","total","total.inf"))))
summaryBy(total+total.inf~hh,x,FUN=sum)
What surprises me are the zeros in the resulting
total.sum column. The problem remains if total.inf is
renamed to totalinf or total_inf but not if renamed to
ttotal.inf .
Can anyone explain to me what the rules for naming
columns are so that I can avoid such mistakes in the
future?
Thanks a lot!
________