[Rd] Unstable reproduce for potential issue with CHARSXP creation

From: Patrick Aboyoun <patrick.aboyoun_at_oracle.com>
Date: Thu, 16 Feb 2012 14:08:50 -0800


I stumbled across one of those intermittent bugs where the code sometimes works and sometimes doesn't. Below is an example run showing a failure where a CHARSXP object was not properly created (by the sub function?). I was able to reproduce this error on three different R builds in fresh R sessions, but it sometimes takes a few start up R -> run code -> close R iterations for the error to show itself.

> x <- data.frame("X1" = 1)
> colnames(x) <- sub("foo", "bar", colnames(x))
> terms(~ ., x)

Error in terms.formula(~., x) : 'getCharCE' must be called on a CHARSXP
> y <- data.frame("X1" = 1)
> colnames(y) <- sub("X", "NEWX", colnames(y))
> terms(~ ., y)

Error in terms.formula(~., y) : 'getCharCE' must be called on a CHARSXP
> sessionInfo()

R Under development (unstable) (2012-02-15 r58359) Platform: x86_64-unknown-linux-gnu (64-bit)

locale:

  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C                 LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

Cheers,
Patrick



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 19 Feb 2012 - 17:12:44 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 19 Feb 2012 - 19:10:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive