I would recommend switching to using "SoilGrids" class:
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")
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
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 <gonzag...@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
(code on:
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@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo