plot shapefile variable: Error invalid gray level, must be in [0,1]. R
up vote
0
down vote
favorite
I have a shapefile which I have run through a spatial regression model in R. I have pulled out the residuals from the regression model and added them as a new variable to the original shapefile. I am hoping to map these residuals but am encountering some issues. Here is my code: plot(shapefile,col=gray(shapefile@data$residuals)) I am receiving this error: invalid gray level, must be in [0,1]. Am I correct in assuming this is to do with the values of the residuals? They span from -40 to +20. Is there a way to change this scale from 0-1 to a larger scale? or an easier way to plot these please? I have also tried spplot: spplot(shape@data$residuals) and receive the error: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘sppl...