楼主: MacJT
1509 3

[程序分享] R语言raster函数 [推广有奖]

  • 0关注
  • 0粉丝

小学生

78%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
53 点
帖子
2
精华
0
在线时间
16 小时
注册时间
2021-6-3
最后登录
2021-7-13

楼主
MacJT 发表于 2021-6-5 00:21:58 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
> 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, ]


二维码

扫码加我 拉你入群

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

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

关键词:Aster RAS R函数 R语言 ACG

沙发
owenqi 在职认证  学生认证  发表于 2021-6-5 12:16:31
我假设你看的是这个
https://rspatial.org/raster/sdm/2_sdm_occdata.html
首先栅格化经纬度的话,需要你的坐标是有规律分布,比如是矩形,比如你可以尝试
  1. m <- raster(matrix(runif(300), 30, 10))
复制代码

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

藤椅
MacJT 发表于 2021-6-5 13:35:35
对的,我就是看的这个教程,为什么要这么做呢

板凳
owenqi 在职认证  学生认证  发表于 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.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-29 21:58