tests/utils/print.R

## print "NAs" as in R >= 4.6.0 to match reference output
if (getRversion() < "4.6.0") {
    print <- function (x) {
        if (inherits(x, "summary.Spatial") && !is.null(x$data))
            x$data <- sub("NA's", "NAs ", x$data, fixed = TRUE)
        else if (is.table(x) && is.character(x))
            x <- sub("NA's", "NAs ", x, fixed = TRUE)
        base::print(x)
    }
}

Try the sp package in your browser

Any scripts or data that you put into this service are public.

sp documentation built on July 19, 2026, 5:06 p.m.