View source: R/logbookAnalyses.R
calculateLogbookPartitionByTrip | R Documentation |
Partitions total catch of each species for each trip on provided grouping variables. NAs in weights are ignored (treated as zero).
calculateLogbookPartitionByTrip(
logbooks,
groupCols,
tripCol = "tripid",
speciesCol = "FANGSTART_FAO",
weightCol = "RUNDVEKT"
)
logbooks |
|
groupCols |
character() vector of names identifying the grouping columns in 'logbooks' |
tripCol |
character() identyfing the column in 'logbooks' that identify a trip |
speciesCol |
character() identyfing the column in 'logbooks' that specify species. |
weightCol |
character() identifying the column in 'logbboks' that specify the live weight of the species. |
Default parameters are compatible readErsFile
with tripids annotated by appendTripIdLogbooks
.
For other partitionings of logbooks, consider tabulateFisheries
.
TripPartition
## Not run:
#make calculate fractions in each area for each trip
lssfile <- "" #set appropriately
logbfile <- "" #set appropriately
landings <- RstoxData::readLssFile(lssfile)
logbooks <- RstoxData::readErsFile(logbfile)
tripIds <- makeTripIds(landings)
logbooksWtripIds <- appendTripIdLogbooks(logbooks, tripIds)
logbooksWtripIds$mainArea <- substring(logbooksWtripIds$LOKASJON_START,1,2)
fractions <- calculateLogbookPartitionByTrip(logbooksWtripIds, "mainArea")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.