Re: [Rd] Unstable reproduce for potential issue with CHARSXP creation

From: Patrick Aboyoun <patrick.aboyoun_at_oracle.com>
Date: Sun, 19 Feb 2012 12:21:30 -0500

This issue was filed in R bugs and addresses by Prof Brian Ripley. I had neglected to name the data argument, but Brian checked in a fix to R-devel so folks who make the same mistake I did will know they supplied the wrong object type to the specials argument in the terms function.

Cheers,
Patrick

On Feb 16, 2012, at 5:08 PM, Patrick Aboyoun <patrick.aboyoun_at_oracle.com> wrote:

> 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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 19 Feb 2012 - 17:32: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:50: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