More

NAs not allowed error message in attempt to plot raster object in R

NAs not allowed error message in attempt to plot raster object in R


I have imported a clipped raster (performed in ArcGIS 10.1) from the National Landcover Dataset into R, but when I try to plot I get the following error message.

Error in .readCellsGDAL(x, uniquecells, layers) : NAs are not allowed in subscripted assignments In addition: Warning message: In .readCells(x, cells, 1) : NAs introduced by coercion

I am relatively new to using rasters in R, but I cannot locate the NAs. levels(nlcd) yields the following:

ID objectID Value Count Red Green Blue Land_Cover_Class opacity 0 1 0 4 0 0 0 Unclassified 1 1 12 11 584837 0.2784314 0.4196078 0.627451 Open Water 1 2 22 21 2247379 0.8666667 0.7882353 0.7882353 Developed, Open Space 1 3 23 22 954664 0.8470588 0.5764706 0.5098039 Developed, Low Intensity 1 4 24 23 647735 0.9294118 0 0 Developed, Medium Intensity 1 5 25 24 333254 0.6666667 0 0 Developed, High Intensity 1 6 32 31 12173780 0.6980392 0.6784314 0.6392157 Barren Land 1 7 42 41 5640937 0.4078431 0.6666667 0.3882353 Deciduous Forest 1 8 43 42 6987282 0.1098039 0.3882353 0.1882353 Evergreen Forest 1 9 44 43 957021 0.7098039 0.7882353 0.5568627 Mixed Forest 1 10 53 52 56354805 0.8 0.7294118 0.4862745 Shrub/Scrub 1 11 72 71 9100560 0.8862745 0.8862745 0.7568627 Herbaceuous 1 12 82 81 477862 0.8588235 0.8470588 0.2352941 Hay/Pasture 1 13 83 82 453351 0.6666667 0.4392157 0.1568627 Cultivated Crops 1 14 91 90 2671979 0.7294118 0.8470588 0.9176471 Woody Wetlands 1 15 96 95 495808 0.4392157 0.6392157 0.7294118 Herbaceuous wetlands 1

The only issue I can see being the problem is the first row.

Below is the code that I used.

library(rgdal) ## spatial library(raster) ## spatial library (rgeos) ## spatial nlcd = raster("C:/Extract_img11.tif") plot(nlcd)

I can't post Extract_img11.tif because it is too large.

Sorry for the vagueness of this question. My guess is that the clipping created the problem, but I haven't ever seen this before.

Thanks for any information.


This appears to have been a bug with the r 'raster' package version 2.2-31 released a bit before this post. I was able to work around the issue by upgrading the package to 2.3-12 which ran the exact same code without the error.


Air Force News Jul-Dec 1932

k r o u b f X sh oa c d i o. • • • • • • • < 2 : G i g i m R c r a c r h l y L r oo ns Ai h k d C i r g h e • • • • • • • • • • • • • • • < 2 : T r o o p s Oem h G o r h a o r o m n whk k A i h k d . • • • • • • • • • • • • • • • < 2 3 E h w T c mt i ms i e Z u r su i t O r b c e i zc t i o e . , • • • • • • • • • • • • • • < 2 3 F cw ci i ce D hp cr t g he t M og g ce dh r R i t eh ss hs B ue eh r y Hx fi li t i oe . • • • <2 3 T c m t i m c k I e s p h m t i o e o a G i t m f h k A i h k d . • • • • • • • • • • • • • • < 2 < c e b h Ai e d i e b I e st r u g h e t s T h st h d i e F c w c i i • • •

• • • • • • • < 2 < i Q f h mk h r A i h k d L h mo g h s c e I d h c k ] p o t . • • • • • • • • • • • • • • • < 2 = T o y s Lo u b f t a o r Xs h c t t f h Cd v c e m h d A k y i e b ] Mf o o k . • • • • • • • • < 2 = T r c i e i e b A k i b f t l y Eh w H e b k c e d

h s h r v h s . • • • • • • • • • • • • • < 2 = C h r i c k Z f o t o b r c p f i m C mt i vi t i h s o a t f h C i r M o r p s. • • • • • • • • • < 2 4 M o k k i si o e w i t f T r h h s M c u sh s T w o D h c t f s. • • • • • • • • • • • • • < 2 4 E hw M k css ]t cr t s Tr ci ei e b ct ce do k pf Ai hk d. • • • • • • • • • • • <2 8 . . < 2 1 K o e b A k i b f t i e t f h Z f i k i p p i e h s • • • • • • • • • • • • • • • • • • < 2 1 c d i o i e t f h Z f i k i p p i e h s • • • • • • • • • • • • • • • • • • • • • < 2 2 - < 2 6 C e C i r - G i e d h d M f i e h sh Y o u t f . • • • • • • • • • • • • • • • • • • • < 2 6 8 t f ] q u c d r oe ] f ow s X p R h k k oe t f h B u e e h r y c e b h . • • • • • • • •

< 2 6 D h vi mh a o r ] c a h r Ak yi e b T f r o u b f Ao b c e d M k o u d s • • • • • • • • • • < 2 9 c d i o C e e o u e mh r ' s @ o l O p h e t o C i r M o r p s O a a i mh r s. • • • • • • • • < 2 9 R r i b ft Ai hk d O a a i mhr s ht ur e a r og Tr ce somhc e i m M oe vh et i oe . • • • • < 6 : R cr D hp cr t g he t O r d hr s C a a hmt i e b C i r M or ps O a a i mhr s • • • • • • • • < 6 3 Z o w h r Z k c e t H e b i e h h r c t R r i b f t Ai h k d Z c ssh s C w c y • • • • • • • • • < 6 3 T h m f e i m c k ] m f o o k ] t u d h e t s Br c d u c t h • • • • • • • • • • • • • • < 6 < I e si b e i c ] ou b f t a o r t f h k k k t f O l sh r vc t i oe ] q u c d r oe . • • • • • • • < 6 < B r c d u c t i o e s a r o g t f h C d v c e mh d Ak y i e b ] mf o o k . • • • • • • • • • < 6 = N c e sc s M i t y C i r h sh r v h X e i t C t t h e d s M o e v h e t i o e . • • • • • • • < 6 = E ot h s a r og C i r M or p s Ai h k d s. • • • • • •.


Watch the video: 三十年中国工业软件从欣欣向荣到溃不成军