Note that there are some explanatory texts on larger screens.

plurals
  1. POvalues not being copied to the next (local) environment?
    primarykey
    data
    text
    <p>Consider this output from <code>browser()</code> that is located inside <code>calcDistance</code>:</p> <pre><code>Called from: calcDistance(object = rst, xy = xy[[i]][j, ], effect.distance = effect.distance) Browse[1]&gt; 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]&gt; debugging in: xyValues(object = object, xy = xy, buffer = effect.distance) debug: standardGeneric("xyValues") Browse[2]&gt; ls.str() object : Formal class 'RasterLayer' [package "raster"] with 12 slots xy : Named num [1:2] -101.8 35.5 </code></pre> <p>Functions are as follows: simulationRun > createDistRaster > calcDistance > raster::xyValues. In the above output, you only see the last two. <code>xyValues</code> is from raster package.</p> <p>First paragraph of code shows that three objects are present: <code>effect.distance</code>, <code>object</code>, <code>xy</code>. In second paragraph, we descend into xyValues by calling debug(xyValues). In third paragraph we can see that <code>effect.distance</code> is missing.</p> <p>My question is: Even though <code>object</code> and <code>xy</code> seem to be copied to the <code>xyValues</code> environment just fine, <code>effect.distance</code> is not. How could this be explained?</p> <p>My sessionInfo()</p> <pre><code>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 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload