[R-sig-Geo] R Basic Info. requried

Matthew Landis landis at isciences.com
Wed Oct 6 17:13:34 CEST 2010


  Malik,

In your example, rasterfile is not a RasterLayer object, but just a 
character vector (and perhaps an empty one at that).  Try 
class(rasterfile) or just type rasterfile at the prompt to see what it is.

I think you need to do:
edwards <- raster('C:/iknos/edwards_airbase_usa_1m_tc.tif')
class(edwards)  # Should indicate that it is a RasterLayer object.
plot(edwards)

or in other words:
rasterfile <- 'C:/iknos/edwards_airbase_usa_1m_tc.tif'
edwards <- raster(rasterfile)
plot(edwards)

Matt


On 10/6/2010 11:04 AM, Malik Shahzad wrote:
> Dear thanks for help,
>
> In first line there is no problem
>
>
>
> rasterfile<-system.file("C:/iknos/edwards_airbase_usa_1m_tc.tif",package="raster")
>
>
>
> This works fine without any error, It mean image has been loaded into variable raster file, but now how i can display raster file in R. I mean I want to see my image that is stored in this variable. When I use plot(rasterfile) it shows error. Before this I work with rImage package to load image(*.jpg) file and then show with the help of plot(image). it works there fine and I can see image but now I am unable to see my output.
>


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~
Matthew Landis, Ph.D.
Research Scientist
ISciences, LLC
61 Main St. Suite 200
Burlington VT 05401
802.864.2999
~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the R-sig-Geo mailing list