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

View source: R/cpuefuncs.r

yearNAR Documentation

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

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

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

## Not run: 
 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")

## End(Not run)

haddonm/rforcpue documentation built on Oct. 12, 2024, 11:55 p.m.