checkDF: checkDF checks a CPUE data.frame has all required fields

View source: R/cpuefuncs.r

checkDFR Documentation

checkDF checks a CPUE data.frame has all required fields

Description

checkDF checks a CPUE data.frame contains all fields expected for analysis. These are year, month, yearq, diver, catch, Long, Lat, Depth, DayNight, Zone, Effort, Method, Fishery, LnCE, and DepCat. If any are missing it identifies them if not it confirms all is ok. Although, except for their class checkDF does not consider the contents of each field. This file needs MODIFICATION

Usage

checkDF(x)

Arguments

x

a data.frame of CPUE data used in the SESSF

Value

only a text message to the console confirming all ok or reporting which fields are missing

Examples

## Not run: 
 dataf <- as.data.frame(matrix(rnorm(100,mean=10,sd=1),nrow=20,ncol=5))
 colnames(dataf) <- c("Year","catch_kg","Long","Zone","LnCE")
 checkDF(dataf)
 dataf <- as.data.frame(matrix(rnorm(42,mean=10,sd=1),nrow=1,ncol=14))
 colnames(dataf) <- c("Year","Month","Vessel","catch_kg","Long","Lat",
                      "Depth","DepCat","DayNight","Zone","Effort",
                      "Method","Fishery","LnCE")
 checkDF(dataf)
 head(dataf)

## End(Not run)

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