I want to suppress a loading message much like in this post, except that I am not loading the whole package but calling a function directly.
For example, calling raster
functions as follows:
f <- system.file("external/test.grd", package="raster")
r <- raster::raster(f)
p <- raster::rasterToPolygons(r, dissolve = TRUE)
Results in the message:
Loading required namespace: rgeos
How can I prevent this message from appearing? The only solution I have found so far is to load rgeos
as follows:
suppressPackageStartupMessages(library(rgeos))
But as I'm using the function raster::rasterToPolygons
from within a package I don't really want to load rgeos
in full.