Consider this output from browser()
that is located inside calcDistance
:
Called from: calcDistance(object = rst, xy = xy[[i]][j, ], effect.distance = effect.distance)
Browse[1]> ls.str()
effect.distance : num 236
object : Formal class 'RasterLayer' [package "raster"] with 12 slots
xy : Named num [1:2] -101.8 35.5
Browse[1]>
debugging in: xyValues(object = object, xy = xy, buffer = effect.distance)
debug: standardGeneric("xyValues")
Browse[2]> ls.str()
object : Formal class 'RasterLayer' [package "raster"] with 12 slots
xy : Named num [1:2] -101.8 35.5
Functions are as follows: simulationRun > createDistRaster > calcDistance > raster::xyValues. In the above output, you only see the last two. xyValues
is from raster package.
First paragraph of code shows that three objects are present: effect.distance
, object
, xy
.
In second paragraph, we descend into xyValues by calling debug(xyValues).
In third paragraph we can see that effect.distance
is missing.
My question is: Even though object
and xy
seem to be copied to the xyValues
environment just fine, effect.distance
is not. How could this be explained?
My sessionInfo()
R version 2.11.1 (2010-05-31)
i386-pc-mingw32
locale:
[1] LC_COLLATE=Slovenian_Slovenia.1250 LC_CTYPE=Slovenian_Slovenia.1250
[3] LC_MONETARY=Slovenian_Slovenia.1250 LC_NUMERIC=C
[5] LC_TIME=Slovenian_Slovenia.1250
attached base packages:
[1] splines stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] raster_1.3-11 foreach_1.3.0 codetools_0.2-2 iterators_1.0.3
[5] Hmisc_3.8-2 survival_2.35-8 spam_0.22-0 splancs_2.01-27
[9] sp_0.9-66 spatstat_1.20-2 deldir_0.0-12 mgcv_1.6-2
loaded via a namespace (and not attached):
[1] cluster_1.12.3 grid_2.11.1 lattice_0.18-8 Matrix_0.999375-39
[5] nlme_3.1-96 tools_2.11.1