[R] bystats2 question

steve fisk at bowdoin.edu
Sat Feb 17 14:17:20 CET 2007


I get a curious error using bystats2 that I can not track down.

I have two variables that are converted from dates
and one numeric variable:

 > str(mon)
  Ord.factor w/ 12 levels "Jan"<"Feb"<"Mar"<..: 1 1 1 1 1 1 1 1 2 2 ...
 > str(yea)
  Ord.factor w/ 4 levels "2004"<"2005"<..: 3 3 3 3 3 3 3 3 3 3 ...
 > str(amount)
  num [1:1103] -44 -10 -17 -80 -20 -50 -58 -14 -28 -46 ...

library(Hmisc)

  date = dates(as.character(Posted.Date))
  month = months(date)
  year = years(date)


yields the  error

 > bystats2(amount,month,year)
Error: object "n" not found

thanks for any suggestions!

Steve



More information about the R-help mailing list