Byte compilation with window<- in R3.4.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Byte compilation with window<- in R3.4.0

Christoph Sax
Hi,

I am running into a problem when I use the window<- replacement function in R
3.4.0. It will lead to an error when it is called inside a loop, probably
the result of the byte compiler now enabled by default.

When I turn it off, it works again, as in older versions of R. I tested on Win,
Linux and Mac, and the problem occurs everywhere.

Here is a reproducible example:

z <- AirPassengers

# this works
window(z, start =  c(1955, 1), end =  c(1955, 1)) <- NA

# but this does not
for (i in 1) {
 window(z, start =  c(1955, 1), end =  c(1955, 1)) <- NA
}
# Error in stats::window(x = `*tmp*`, start = c(1955, 1), end = c(1955,  :
#   object '*tmp*' not found

# turning off the byte compiler makes it working again (as in older R versions)
compiler::enableJIT(0)
for (i in 1) {
 window(z, start =  c(1955, 1), end =  c(1955, 1)) <- NA
}

Any help is very much appreciated.

Thanks,
Christoph

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Byte compilation with window<- in R3.4.0

Tomas Kalibera
Thanks for the report, fixed in R-devel and R-patched.

Best
Tomas

On 04/30/2017 10:48 PM, Christoph Sax wrote:

> Hi,
>
> I am running into a problem when I use the window<- replacement function in R
> 3.4.0. It will lead to an error when it is called inside a loop, probably
> the result of the byte compiler now enabled by default.
>
> When I turn it off, it works again, as in older versions of R. I tested on Win,
> Linux and Mac, and the problem occurs everywhere.
>
> Here is a reproducible example:
>
> z <- AirPassengers
>
> # this works
> window(z, start =  c(1955, 1), end =  c(1955, 1)) <- NA
>
> # but this does not
> for (i in 1) {
>   window(z, start =  c(1955, 1), end =  c(1955, 1)) <- NA
> }
> # Error in stats::window(x = `*tmp*`, start = c(1955, 1), end = c(1955,  :
> #   object '*tmp*' not found
>
> # turning off the byte compiler makes it working again (as in older R versions)
> compiler::enableJIT(0)
> for (i in 1) {
>   window(z, start =  c(1955, 1), end =  c(1955, 1)) <- NA
> }
>
> Any help is very much appreciated.
>
> Thanks,
> Christoph
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel