[R] two bugs ?

ken_lee ken_lee at tynesys.com
Thu Aug 22 03:57:54 CEST 2002


Dear,
       I thought these two example are bugs. 
example 1:  colnames issue
 > tmp<-data.frame(value=1:3,group1=1:3)     
 > if (length(tmp$group)>1) z<-1 else z<-2
 > print(z)

   [1] 1

example2 :  length issue
> tmp<-data.frame(value=1:3,group=c("a","a","b")  )
> tmp1<-gsummary(tmp,FUN=length,groups=tmp$group)
> tmp1
  value group
a     2     a
b     1     b

> tmp<-data.frame(value=1:3,group=c("a","c","b"))  
> tmp1<-gsummary(tmp,FUN=length,groups=tmp$group)
> tmp1
  value group
a     1     a
b     3     b
c     2     c

ken
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list