[R-sig-Geo] Error creating GlobalSoilMap object (GSIF package)
Tomislav Hengl
hengl at spatial-analyst.net
Sat Jun 21 08:02:18 CEST 2014
Sorry for that bug. You need to get GSIF v0.4-2 or higher and then the
SoilGrids objects will compile
(http://gsif.r-forge.r-project.org/SoilGrids.html).
Looks like R-forge is still building the package
(http://r-forge.r-project.org/R/?group_id=1125). I will try to put the
new version on CRAN next week. In the meanwhile you should be able to
install it by running:
install.packages("GSIF", repos=c("http://R-Forge.R-project.org"), type =
"source")
On 18-6-2014 16:55, Ruth Gonzaga wrote:
> Thanks for the suggestion, but I am still getting an error:
>
> > SNDMHT.gsm <- SoilGrids(obj=sd.ll, varname="SNDPPT",
> TimeSpan=list(begin="1999-02-01", end="2001-07-01"))
> Error in validityMethod(object) :
> no slot of name "TimeSpan.begin" for this object of class "GlobalSoilMap"
>
> I am on Windows 8 using GSIF version 4-01. I will try to load this on a
> Ubuntu Virtual Machine to see if it turns out differently.
> Ruth
>
>
> On 18 June 2014 14:41, Tomislav Hengl <hengl at spatial-analyst.net
> <mailto:hengl at spatial-analyst.net>> wrote:
>
>
> I would recommend switching to using "SoilGrids" class:
>
> http://gsif.r-forge.r-project.__org/SoilGrids.html
> <http://gsif.r-forge.r-project.org/SoilGrids.html>
>
> Hence, to produce objects of SoilGrids class you need to use:
>
> ## save to a "SoilGrids" object:
> SNDMHT.gsm <- SoilGrids(obj=sd.ll, varname="SNDPPT",
> TimeSpan=list(begin="1999-02-__01", end="2001-07-01"))
>
> In which case TimeSpan needs to be a list with names "begin", "end".
>
> To install the most recent version of the GSIF package (v0.4-2),
> please use:
>
> install.packages("GSIF", repos="http://R-Forge.R-__project.org
> <http://R-Forge.R-project.org>")
>
> For technical issues and problems with SoilGrids classes please also
> consider writing to the GSIF mailing list at:
>
> https://groups.google.com/__forum/#!forum/global-soil-__information
> <https://groups.google.com/forum/#!forum/global-soil-information>
>
> HTH
>
> T. Hengl
>
> On 18-6-2014 3:12, Pascal Oettli wrote:
>
> Hello,
>
> According to the help file, TimeSpan is an "object of class "list";
> contains begin and end of the sampling period of class
> "POSIXct"". You
> need to provide a list of POSIXct dates, not a vector.
>
> HTH
> Pascal
>
> On Wed, Jun 18, 2014 at 8:56 AM, Ruth Gonzaga
> <gonzagarg at yahoo.com.br <mailto:gonzagarg at yahoo.com.br>> wrote:
>
> Dear All,
> I have been trying to follow this tutorial on 3D modelling
> of soil with the
> GSIF package:
> http://gsif.isric.org/doku.__php?id=wiki:tutorial_eberg
> <http://gsif.isric.org/doku.php?id=wiki:tutorial_eberg>
>
> (code on:
> https://code.google.com/p/__gsif/source/browse/trunk/__eberg/tutorial_eberg.R
> <https://code.google.com/p/gsif/source/browse/trunk/eberg/tutorial_eberg.R>)
>
> When I get to creating a GlobalSoilMap object (line 181):
>
> SNDMHT.gsm <- GlobalSoilMap(sd.ll, varname="SNDMHT",
> period=c("1999-02-01",
> "2001-07-01"))
>
> I get an error saying:
> Error in GlobalSoilMap(sd.ll, varname = "SNDMHT", period =
> c("1999-02-01",
> : unused argument (period = c("1999-02-01", "2001-07-01"))
>
> I think the tutorial is quite old. I checked the help and
> then replaced
> "period" for "TimeSpan". I now get the following error:
> Error in initialize(value, ...) :
> invalid name for slot of class "GlobalSoilMap":
> TimeSpan.begin
>
>
> Here is some information on this function:
>
> GlobalSoilMap function (obj, varname, TimeSpan =
> list(begin = Sys.Date()
>
> - 1, end = Sys.Date())) { if (!class(obj) == "list") {
> stop("Object of
> class 'list' required") } out = new("GlobalSoilMap", varname
> = varname,
> TimeSpan.begin = TimeSpan, sd1 = as(obj[[1]],
> "SpatialPixelsDataFrame"),
> sd2 = as(obj[[2]], "SpatialPixelsDataFrame"), sd3 = as(obj[[3]],
> "SpatialPixelsDataFrame"), sd4 = as(obj[[4]],
> "SpatialPixelsDataFrame"),
> sd5 = as(obj[[5]], "SpatialPixelsDataFrame"), sd6 = as(obj[[6]],
> "SpatialPixelsDataFrame")) return(out)
> }
>
> Any ideas?
> Thanks.
>
> Ruth
>
> [[alternative HTML version deleted]]
>
> _________________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/__listinfo/r-sig-geo
> <https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>
>
>
>
>
> _________________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/__listinfo/r-sig-geo
> <https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>
>
More information about the R-sig-Geo
mailing list