[R] RW 0.64.2 substring() string truncation?

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Aug 3 10:09:04 CEST 1999


"T.E.Diaz" <tediaz at gwis2.circ.gwu.edu> writes:

> [1] 8192
> > tmp <- paste(tmp,"23456789",sep="",collapse="")
> > nchar(tmp)
> [1] 8200
> > substring(tmp,8190,8192)
> [1] "111"
> > substring(tmp,8190,8193)
> Warning in substr(x, as.integer(start), as.integer(stop)) : a string was truncated in substr()
> [1] "111"

Possibly - ;) - related to this:

src/include/Defn.h:#define MAXELTSIZE 8192 /* The largest string size */

There are a couple of fixed-size arrays in the code. We'll want to
eradicate them at some point but it's pretty painful to do. Do you
have a serious application for text strings of more than 8k length?

-- 
   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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list