yearZero | R Documentation |
yearZero - examines an input data.frame of matrix in the variables listed in the parameter 'label' and counts the zeros, NAs, and those >0. It counts these relative to a 'Year' variable, or any grouping variable identified using the 'years' parameter.
yearZero(indat, years = "Year", label = c("catch_kg", "Effort"))
indat |
the data.frame or matrix to be examined |
years |
the grouping variable for counts to be compared across, defaults to 'Year' |
label |
the collection of column names which are to be examined, defaults to c('catch_kg','Effort'), which is suitable for SESSF data sets.#' |
A matrix of the variables in 'label' with a column for each of Zeros, >0, and NAs, with a final column of the number of records per grouping variable value.
## Not run:
insps <- matrix(runif(30),nrow=15,ncol=2)
insps[trunc(runif(7)*30)+1] <- 0
insps[trunc(runif(7)*30)+1] <- NA
insps <- cbind(sort(rep(2000:2004,3)),insps)
colnames(insps) <- c("Year","catch_kg","Effort")
print(round(insps,4))
yearZero(insps)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.