mow: Remove unused rasters and vectors from the GRASS cache

View source: R/mow.r

mowR Documentation

Remove unused rasters and vectors from the GRASS cache

Description

fasterRaster attempts to delete rasters and vectors in the GRASS cache. This function will a) search the current GRASS "project/location" cache for all rasters/vectors there; and b) remove any of them that are not pointed to by an object in the active R environment. Only objects in the currently active GRASS project/location will be removed (see vignette("project_mapset", package = "fasterRaster")).

Note that calling this function inside another function's environment without providing an argument for x can be very dangerous, as it will detect objects outside that environment, and thus delete any rasters/vectors outside that environment.

Usage

mow(x, type = NULL, keep = NULL, verbose = TRUE, ask = TRUE)

Arguments

x

Either missing (default) or an environment.

type

Either NULL or a character vector. If NULL, all rasters and vectors in the GRASS cache are candidates for deletion. Otherwise, this can be either "raster", "vector", or both.

keep

Either NULL (default) or a list() of GRasters and/or GVectors that you want to retain. The rasters and vectors in GRASS pointed to by these objects will not be deleted.

verbose

Logical: If TRUE (default), report progress.

ask

Logical: If TRUE (default), prompt for reassurance.

Value

Invisibly returns a list with the number of rasters and vectors deleted.

See Also

Option clean in faster()

Examples

if (grassStarted()) {

if (FALSE) mow()

}

adamlilith/fasterRaster documentation built on Oct. 26, 2024, 4:06 p.m.