[R] match and as.character truncation

Eric Weese weese at MIT.EDU
Fri Aug 1 20:18:24 CEST 2008


I know the following is documented behaviour, in the sense that the  
help page for as.character mentions  that it truncates at about 500  
characters... but wouldn't it be better if there was a warning of  
some sort issued?  Or am I misunderstanding what's happening here?

 > str <- sample(LETTERS,301, replace=TRUE)
 > search.list <- list(str[-301],str)
 > item <- list(str)                        # == search.list[2]
 > match(item, search.list)
[1] 1
 > item <- list(str[1:299])
 > match(item, search.list)
[1] 1
 > item <- list(str[1:29])
 > match(item, search.list)
[1] NA
 > version$version.string
[1] "R version 2.7.1 (2008-06-23)"

Thanks.



-Eric Weese
PhD candidate, Economics
MIT



More information about the R-help mailing list