[R] library(fields) world shift function not working anymore

Ray Brownrigg ray at mcs.vuw.ac.nz
Mon Nov 29 21:07:01 CET 2004


> I just upgraded to 2.01 on Mac OS 10.3.6.  I used to use the command 
> (on R 1.9.x):
> 
> world(ylim=c(-30,30), xlim = c(0,360), shift=TRUE, add=TRUE)
> 
> to draw a world outline over my image plots.  My data uses longitude 
> from (0, 360) so I need to use the shift function.  After I upgraded, I 
> get the following error:
> 
>  > world(ylim=c(-30,30), xlim = c(0,360), shift=TRUE, add=TRUE)
> Error in world(ylim = c(-30, 30), xlim = c(0, 360), shift = TRUE, add = 
> TRUE) :
> 	NAs are not allowed in subscripted assignments
> 
> Does anyone know a workaround for this?
> 
Well, a workaround would be:
library(maps)
map("world2", ylim=c(-30,30), xlim = c(0,360), add = TRUE)

(at least until fields is updated).

                CHANGES IN R VERSION 2.0.0

    o   Subassignments involving NAs and with a replacement value of
        length > 1 are now disallowed.  (They were handled
        inconsistently in R < 2.0.0, see PR#7210.)  For data frames
        they are disallowed altogether, even for logical matrix indices
        (the only case which used to work).

Ray Brownrigg




More information about the R-help mailing list