提问人:Takis Pitsakis 提问时间:10/23/2023 最后编辑:Severin PappadeuxTakis Pitsakis 更新时间:10/24/2023 访问量:24
dwp 包在 FUN(X[[i]], ...) 中给我错误:!anyNA(x) 不是 TRUE
dwp package gives me Error in FUN(X[[i]], ...) : !anyNA(x) is not TRUE
问:
我正在使用 dwp 包来“考虑搜索区域之外的尸体比例 以及风能设施中鸟类和蝙蝠死亡人数的估计” 我添加了 3 个 shapefile,SP8_BOX、SP8、胴体。
- SP8_B0X 是一个多多边形,属性表中有 3 列(OBJECTID、Turbine、Class)
- SP8 带涡轮柱
- 胴体(涡轮机、物种、日期)
`# import site layout and carcass observation distances from shape files
layout_shape <- initLayout(data_layout = "SP8_BOX.shp",
file_turbine = "SP8.shp", unitCol = "Turbine")
cod <- readCarcass("carcasses.shp", unitCol = "Turbine")
rings_shape <- prepRing(layout_shape, scVar = "Class", notSearched = "Out")`
布局形状和 cod 是正常创建的,但 prepRing 给了我
Error in FUN(X[[i]], ...) : !anyNA(x) is not TRUE
我试过了
lapply(layout_shape, is.na)
$layout
OBJECTID Turbine Class geometry
1 FALSE FALSE FALSE FALSE
2 FALSE FALSE FALSE FALSE
3 FALSE FALSE FALSE FALSE
4 FALSE FALSE FALSE FALSE
5 FALSE FALSE FALSE FALSE
6 FALSE FALSE FALSE FALSE
$layoutAdj
OBJECTID Turbine Class geometry
1 FALSE FALSE FALSE FALSE
2 FALSE FALSE FALSE FALSE
3 FALSE FALSE FALSE FALSE
4 FALSE FALSE FALSE FALSE
5 FALSE FALSE FALSE FALSE
6 FALSE FALSE FALSE FALSE
$turbines
Turbine geometry
1 FALSE FALSE
$unitCol
[1] FALSE
$tset
[1] FALSE
$tcenter
X Y
SP8 FALSE FALSE
str(layout_shape$turbines)
Classes ‘sf’ and 'data.frame': 1 obs. of 2 variables:
$ Turbine : chr "SP8"
$ geometry:sfc_POINT of length 1; first list element: 'XY' num 24.4 38.1
- attr(*, "sf_column")= chr "geometry"
- attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA
..- attr(*, "names")= chr "Turbine"
这里显示了一些 NA 值,但当我
str(layout_shape$turbines$geometry)
sfc_POINT of length 1; first list element: 'XY' num [1:2] 24.4 38.1
head(layout_shape$turbines$geometry)
Geometry set for 1 feature
Geometry type: POINT
Dimension: XY
Bounding box: xmin: 24.XXXX ymin: 38.XXXXX xmax: 24.XXXX ymax: 38.XXXXX
Geodetic CRS: WGS 84
POINT (24.XXXXX 38.XXXXX)
坐标,其中 X 由 me 替换。
答: 暂无答案
评论