R Package Warning: multiple methods tables found for 'direction'

Solution 1:

> library(sp)
> library(raster)
Warning messages:
1: multiple methods tables found for 'direction' 
2: multiple methods tables found for 'gridDistance' 

New session:

> 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.

It looks as though both raster and terra define these generics, terra 1.5-12 was just published. Resolution: https://github.com/rspatial/terra/issues/485#issuecomment-1012466626, re-install raster after terra.