我有建立在R包Spatstat点模式的一些问题。
> HI06mfav <- read.table("MarHI06mfav.txt", header = TRUE)
> attach(HI06mfav)
The following object(s) are masked _by_ '.GlobalEnv':
x, y
The following object(s) are masked from 'HI06mfav (position 3)':
x, y
> HI06mfav.P <- ppp(x, y, c(-1, 11), c(-1, 11))
Warning message:
In ppp(x, y, c(-1, 11), c(-1, 11)) :
10 points were rejected as lying outside the specified window
> HI06mfav
x y
1 4.100800 6.526913
2 3.710310 6.189953
3 3.030026 6.696919
4 2.747816 6.417674
5 2.955485 6.125787
6 3.299942 5.922913
7 2.932207 5.549772
8 2.681645 5.641663
9 1.858555 5.686039
10 2.069101 5.427891
11 2.387927 5.227459
12 2.530470 5.383951
13 2.783648 5.019703
14 2.219491 4.767310
15 6.591515 8.160451
16 6.600408 8.567767
17 3.098551 3.561141
18 2.634305 3.571341
我以前也使用过相同的代码,一切工作正常,所以我在它为什么不现在的工作感到困惑。 我知道,我可能需要使用其他附加(),但之后,我尝试创建PPP我不理解的错误。
它甚至不会从Spatstat引导权而采取的示例代码同样的事情:
> w <- owin(c(-1,1), c(-1,1))
> w <- as.mask(w)
> X <- raster.x(w)
> Y <- raster.y(w)
> M <- (X^2 + Y^2 <= 1)
> pp <- ppp(x, y, c(-1,1), c(-1,1), mask=M)
Warning message:
In ppp(x, y, c(-1, 1), c(-1, 1), mask = M) :
10 points were rejected as lying outside the specified window
> pp
planar point pattern: 0 points
window: binary image mask
100 x 100 pixel array (ny, nx)
enclosing rectangle: [-1, 1] x [-1, 1] units
我要回通过spatstat指导揣摩了这一点,但任何帮助将是非常赞赏。