全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1410 3
2021-06-05
> r <- raster(acg)
Error in .local(x, ...) : list has no "x"
请问怎么解决


还有,这下面一段代表什么意思
i <- acg$lon > 0 & acg$lat > 0
acg$lon <- -1 * acg$lon
acg$lat <- -1 * acg$lat
acg <- acg[acg$lon < -50 & acg$lat > -50, ]


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2021-6-5 12:16:31
我假设你看的是这个
https://rspatial.org/raster/sdm/2_sdm_occdata.html
首先栅格化经纬度的话,需要你的坐标是有规律分布,比如是矩形,比如你可以尝试
复制代码

那些代码实际上是根据经纬度筛选一些合格的点,我引用原文的话
repatriate the records near Pakistan to Argentina, and remove the records in Brazil, Antarctica, and with longitude=0
也就是把巴基斯坦附近的观测放到阿根廷,再移除巴西,南极的和经度0度的数据。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-6-5 13:35:35
对的,我就是看的这个教程,为什么要这么做呢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-6-5 21:06:38
MacJT 发表于 2021-6-5 13:35
对的,我就是看的这个教程,为什么要这么做呢
那你可能需要仔细重读一下原文,关于巴基斯坦的数据里面提到
There are a few records that map in the ocean just south of Pakistan. Any idea why that may have happened? It is a common mistake, missing minus signs. The coordinates are around (65.4, 23.4) but they should in Northern Argentina, around (-65.4, -23.4)
关于南极
There are two records (rows 303 and 885) that map to the same spot in Antarctica (-76.3, -76.3). The locality description says that is should be in Huarochiri, near Lima, Peru. So the longitude is probably correct, and erroneously copied to the latitude.
关于巴西
The point in Brazil (record acaule[98,]) should be in soutern Bolivia, so this is probably due to a typo in the longitude.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群