Skip to content
Prev 10325 / 29559 Next

SGDF with NA values - SGDF2PCT()

Hello,

I want to convert my three-band SGDF into a single color vector using the SGDF2PCT() function in rgdal. Unfortunately my SGDF contains NA values. To plot it with image() this is no problem, because NAs were fully transparent, but if I want to convert my three bands with SGDF2PCT() I get an error message.
I guess there is an easy way to handle NA values in SpatialGridDataFrame. Can someone please help me?

Here an example:
### now introduce some NA values
Error in if (bmax == bmin) bmax <- bmin + ncolors : 
  missing value where TRUE/FALSE needed

Thank you.
TIM

----------------------------------------------------------------------------------- 
Tim H?ring
Bavarian State Institute of Forest Research 
Department of Forest Ecology
Hans-Carl-von-Carlowitz-Platz 1
D-85354 Freising