yearNA: yearNA - counts NAs per year in each numeric field in a...

Description Usage Arguments Value Examples

View source: R/cpuefuncs.r

Description

yearNA - counts the number of NAs in each year of each numeric field in a data.frame and outputs the results as a matrix

Usage

1
yearNA(indat, years = "Year", empty = FALSE)

Arguments

indat

the data.frame whose numeric fields are to be considered

years

identifies the name of the "Year" field in the data.frame

empty

logical default=FALSE, determines whether columns which have no NA present are printed or not

Value

a matrix of years x numeric fields with the number of records per field per year as reference

Examples

1
2
3
4
5
6
7
year <- sort(rep(1990:1994,5))
columns <- c("year","Var1","Var2","Var3")
dat <- matrix(runif(100),nrow=25,ncol=4,dimnames=list(year,columns))
dat[trunc(100*runif(20))] <- NA
dat[,1] <- year
print(dat)
yearNA(as.data.frame(dat),years="year")

haddonm/r4cpue documentation built on May 11, 2020, 1:31 a.m.