小智 5
> library(sp)
> library(raster)
Warning messages:
1: multiple methods tables found for 'direction'
2: multiple methods tables found for 'gridDistance'
Run Code Online (Sandbox Code Playgroud)
新会话:
> raster::direction
standardGeneric for "direction" defined from package "raster"
function (x, ...)
standardGeneric("direction")
<bytecode: 0x8163a60>
<environment: 0x81349e0>
Methods may be defined for arguments: x
Use showMethods(direction) for currently available ones.
Warning messages:
1: multiple methods tables found for 'direction'
2: multiple methods tables found for 'gridDistance'
> terra::direction
standardGeneric for "direction" defined from package "terra"
function (x, ...)
standardGeneric("direction")
<bytecode: 0x312a030>
<environment: 0x30e2640>
Methods may be defined for arguments: x
Use showMethods(direction) for currently available ones.
Run Code Online (Sandbox Code Playgroud)
看起来raster和terra都定义了这些泛型,terra 1.5-12 刚刚发布。解决方案: https://github.com/rspatial/terra/issues/485#issuecomment-1012466626 ,在terra之后重新安装raster。