Jenny Fox
2004-Nov-29 17:31 UTC
[R] library(fields) world shift function not working anymore
Hi there. 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? Thank you. Jennifer Fox Graduate Researcher NOAA Aeronomy Laboratory Boulder, CO jfox@al.noaa.gov [[alternative text/enriched version deleted]]
Ray Brownrigg
2004-Nov-29 20:07 UTC
[R] library(fields) world shift function not working anymore
> 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
Apparently Analagous Threads
- image() or plotting functions or something else broken in 2.0.1 on OS X?
- Subassignments involving NAs in data frames
- Error: NAs are not allowed in subscripted assignments: change from R.1.9
- installation of package 'mapproj' had non-zero exit status
- map does not display maps, MacOSX