[R] Understanding how R works
Alaios
alaios at yahoo.com
Wed Jul 28 10:08:37 CEST 2010
Hello everyone.
I am more than new into R.
Today I have started reading about grf function that is included in geoR
package.
According the manual (vignette?)
grf() generates (unconditional) simulations of Gaussian random fields for given
covariance parameters. geoR2RF converts model specification used by geoR to the
correponding one in RandomFields.
I would like to use this function to fill in with valies a rasterlayer.
According to the manual grf() returns a list
Value
grf returns a list with the components:
coords an n x 2 matrix with the coordinates of the simulated data.
data a vector (if nsim = 1) or a matrix with the simulated values. For the
latter each column corresponds to one simulation.
cov.model a string with the name of the correlation function.
nugget the value of the nugget parameter.
cov.pars a vector with the values of sigma^2 and phi, respectively.
kappa value of the parameter kappa.
lambda value of the Box-Cox transformation parameter lambda.
aniso.pars a vector with values of the anisotropy parameters, if provided in
the function call.
method a string with the name of the simulation method used.
sim.dim a string "1d" or "2d" indicating the spatial dimension of the
simulation.
.Random.seed the random seed by the time the function was called.
messages messages produced by the function describing the simulation.
call the function call.
geoR2grf returns a list with the components:
model RandomFields name of the correlation model
param RandomFields parameter vector
And this is exactly the point I do not get.
In the example section of the same function I can find the following:
sim1 <- grf(100, cov.pars = c(1, .25))
# a display of simulated locations and values
points(sim1)
How the function points() understand what to read exactly from the list?
I would like tot hank you in advance for your replies
Best Regards
Alex
More information about the R-help
mailing list