On 12/08/19 8:51 AM, Joe Lewis wrote:
Dear list, I'm trying to use a user-supplied list of point patterns in envelope() rather than test against the CSR. Page 400 of Spatial Point Patterns: Methodology and Applications in R states that "the argument simulate can be a list of point patterns". However, I get the following error when I try to supply a list of ppp: ekls <- envelope.lpp(Y = xx, fun = linearK, nsim=5, simulate = pp_list) Error in envelopeEngine(X = X, fun = fun, simul = simrecipe, nsim = nsim, : ‘simulate’ should be an expression, or a list of point patterns for reference, xx Point pattern on linear network 680 points Linear network with 22 vertices and 21 lines Enclosing window: rectangle = [284086.69, 309740] x [709900, 726547.7] metres class(xx) [1] "lpp" "ppx" pp_list List of point patterns Component 1: Planar point pattern: 513 points window: rectangle = [284086.69, 309740] x [709900, 726547.7] metres Component 2: Planar point pattern: 422 points window: rectangle = [284086.69, 309740] x [709900, 726547.7] metres Component 3: Planar point pattern: 495 points window: rectangle = [284086.69, 309740] x [709900, 726547.7] metres Component 4: Planar point pattern: 557 points window: rectangle = [284086.69, 309740] x [709900, 726547.7] metres Component 5: Planar point pattern: 576 points window: rectangle = [284086.69, 309740] x [709900, 726547.7] metres class(pp_list) [1] "ppplist" "solist" "anylist" "listof" "list" Any ideas why the error is occurring? Thanks.
It's hard to say without having a *reproducible* example. Since we don't have access to "xx" or to "pp.list" we cannot experiment to see what's going on.
One problem that leaps out at me --- although it doesn't seem that this should trigger the error message that you received --- is that the entries of pp_list appear to be *planar point patterns* (of class "ppp") whereas "xx" is a pattern on a linear network (of class "lpp"). Consequently there is a fundamental incompatibility here.
However I don't see why you would get the error message that you did. I am CC-ing this email to Adrian Baddeley who has more insight than I, and may be able to point you in the right direction. Adrian is kind of overwhelmed with work at the moment, so it may be a while till you hear from him.
If you provide a reproducible example I *may* be able to help. cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo