Learn R Programming

dietr (version 1.1.6-1)

ConvertFishbaseFood: Converts FishBase/SealifBase food item diet data obtained from the diet function into a usable format for dietr

Description

Converts FishBase/SealifBase food item diet data obtained from the diet function into a usable format for dietr

Usage

ConvertFishbaseFood(FishBaseFood, ExcludeStage = NULL)

Value

a list of length two, with two data frames. One containing the re-formatted food item data and one containing the Taxonomy with species names.

Arguments

FishBaseFood

a data frame produced by the rfishbase fooditem function

ExcludeStage

a character, indicating which life stages to exclude. Must match stage names given by rfishbase (i.e. larvae, rec./juveniles, juv./adults, adults).

Author

Samuel Borstein

Details

This converts the data frame produced by rfishbase fooditem function into a usable format for dietr.

Examples

Run this code
if (FALSE) { # interactive()
# \donttest{
#Get rfishbase food item data for a few species
my.food <- try(as.data.frame(rfishbase::fooditems(c("Lutjanus apodus","Epinephelus itajara"))))
if (!"try-error" %in% class(my.food)) {
#use the ConvertFishbaseFood function to format it for dietr and exclude recruits/juveniles
cleaned.food <- ConvertFishbaseFood(FishBaseFood=my.food, ExcludeStage=c("larvae","recruits/juv."))
cleaned.food
}
# }
}

Run the code above in your browser using DataLab