This was probably meant for the mailing list.

Try reloading the data from scratch. What other packages are you also
loading? Are all the packages up to date?

Cheers,
Roman



---------- Forwarded message ----------
From: Céline Bellard <bellard.celine@gmail.com>
Date: Wed, Sep 5, 2012 at 10:23 AM
Subject: Re: [R-sig-Geo] raster package
To: Roman Luštrik <roman.lustrik@gmail.com>


 Dear Sarah,

Indeed it works with a clean R session but I still don't understand what is
the pb with my workspace or my data ? I will investigate it.

Thank for your help.

Céline


Le 9/4/12 9:32 PM, Roman Luštrik a écrit :

Is this the behavior you see with a clean R session (no saved workspaces or
anything)?



On Tue, Sep 4, 2012 at 9:26 PM, Céline Bellard <bellard.celine@gmail.com>wrote:

> Hello,
>
> As you see in my example, I can't use plot function from raster library.
> First thing is that it seems that plot function hasn't the priority over
> the plot function from graphics package. But even if I use explicitly the
> plot function from raster package, it don't work. Have you any suggestion ?
>
>  library(raster)
>> r=raster()
>> values(r)=runif(ncell(r))
>> r
>>
> class       : RasterLayer
> dimensions  : 180, 360, 64800  (nrow, ncol, ncell)
> resolution  : 1, 1  (x, y)
> extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
> coord. ref. : +proj=longlat +datum=WGS84
> data source : in memory
> names       : layer
> values      : 4.09456e-06, 0.9999978  (min, max)
>
>  plot(r)
>>
> Erreur dans as.double(y) :
> cannot coerce type 'S4' to vector of type 'double'
>
>> detach("package:raster")
>> plot(r)
>>
> Erreur dans as.double(y) :
> cannot coerce type 'S4' to vector of type 'double'
>
>> library(raster)
>> search()
>>
> [1] ".GlobalEnv"        "package:raster"    "package:sp" "tools:rstudio"
> [5] "package:stats"     "package:graphics"  "package:grDevices"
> "package:utils"
> [9] "package:datasets"  "package:methods"   "Autoloads" "package:base"
>
>> raster:::plot(r)
>>
> Erreur dans get(name, envir = asNamespace(pkg), inherits = FALSE) :
> objet 'plot' introuvable
>
> Thank you for your help,
>
> Céline
>
> --
> Céline Bellard, PhD student
>
> Lab ESE, UMR CNRS 8079
>
> Univ Paris-Sud Tel  (0033/0) 1 69 15 56 85
>
> Bat 362
>
> F-91405  Orsay Cedex FRANCE
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



 --
In God we trust, all others bring data.



-- 
Céline Bellard, PhD student

Lab ESE, UMR CNRS 8079

Univ Paris-Sud Tel  (0033/0) 1 69 15 56 85

Bat 362

F-91405  Orsay Cedex FRANCE




-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

