[R] How to represent certain values in a file as we want?

David Winsemius dwinsemius at comcast.net
Mon Apr 1 08:22:39 CEST 2013

On Mar 31, 2013, at 12:37 PM, Jonsson wrote:

> I got this erro
> Error in c("red", "blue", "green")[r] : invalid subscript type 'S4'
I don't have your data so testing is not possible. I assumed a plot call was base graphics and that 'r' was a vector. I was wrong. It's an S4 object. I would follow the examples in the plot.raster page and try:

   plot(r, col=colorRampPalette(c("red", "white", "blue"))(3) )

You should learn how to use your mail client to send context.

Snipped Nabble stuff


David Winsemius
Alameda, CA, USA

More information about the R-help mailing list