Colin Farrow <c.farrow at compserv.gla.ac.uk> writes:> here is a distillation of a problem encountered in transfering some > working code from R-0.63 to R-1.1.0 > > a1 <- 1:10 > b1 <- tapply(a1,a1, sum) > c1 <- ts(b1) > c1 > Error in if (NCOL(x) == 1) { : missing value where logical needed > > note that the error is returned as the value of calling ts() and is not > automatically displayed > > problem seems to be that > is.array(b1) returns TRUE > yet dim(b1) returns 10 > > bug or feature or am I missing something?It's a feature in tapply that it generates a 1-D array, but one might consider it a bug in print.ts, ts, or NCOL that the dim() is carried through and the 1-D case not handled. You can easily work around it by setting dim(c1)<-NULL or dim(b1)<-NULL. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
here is a distillation of a problem encountered in transfering some working code from R-0.63 to R-1.1.0 a1 <- 1:10 b1 <- tapply(a1,a1, sum) c1 <- ts(b1) c1 Error in if (NCOL(x) == 1) { : missing value where logical needed note that the error is returned as the value of calling ts() and is not automatically displayed problem seems to be that is.array(b1) returns TRUE yet dim(b1) returns 10 bug or feature or am I missing something? platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 1 minor 1.0 year 2000 month June day 15 language R with grateful thanks to R-core for a wonderful tool. -- Colin Farrow Computing Service, University of Glasgow, Glasgow G12 8QQ Tel: 0141 330 4862, c.farrow at compserv.gla.ac.uk -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._