TrimNA: Remove leading and trailing rows of all NA

View source: R/SpecACF.R

TrimNAR Documentation

Remove leading and trailing rows of all NA

Description

Remove leading and trailing rows of all NA

Usage

TrimNA(m, trim = c("all", "any"))

Arguments

m

a numeric matrix, data.frame or vector

trim

trim leading and trailing rows of "all" NA or containing "any" NA values

Value

a numeric matrix, data.frame or vector

Examples

m <- matrix(c(NA, NA, NA, 1, NA, NA, NA, 1, 1, NA, NA, NA, 1:9, NA,NA,NA, 10:12, NA, 1, NA, NA,NA,NA), ncol = 3, byrow = TRUE)
m
TrimNA(m)
TrimNA(m, trim = "any")

EarthSystemDiagnostics/paleospec documentation built on Feb. 17, 2024, 4:36 p.m.