yearNA | R Documentation |
yearNA - counts the number of NAs in each year of each numeric field in a data.frame and outputs the results as a matrix
yearNA(indat, years = "Year", empty = FALSE)
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 |
a matrix of years x numeric fields with the number of records per field per year as reference
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.