View source: R/fishtrendplots.R
fishtrendplots | R Documentation |
This function creates and saves fish trend scatter plots comparing CPUE across surveys. It will also save a .csv table with trend statistics calculated with the fishstats() function.
fishtrendplots(
plotdata,
logtransform = TRUE,
saveto = paste0(getwd()),
ptcolor = "blue",
ptsize = 3,
pttype = 20,
addlm = TRUE,
lmcolor = "black",
lmsize = 1,
lmtype = 2,
includestats = TRUE,
statstable = TRUE,
maxpvalue = 0.1
)
plotdata |
a water quality data.frame created with the fishtable() function. |
logtransform |
a logical indicating whether the statistics should be calulated using the natural log of the CPUE +1 values. Defaults to TRUE. |
saveto |
designates the folder where the plots and table should be saved. Defaults to the working directory. |
ptcolor |
designates the color of the points in the plots. Defaults to "blue". |
ptsize |
designates the size of the points in the plots. Defaults to 3. |
pttype |
designates the type of the points in the plots. Defaults to 20. |
addlm |
a logical indicating whether the linear regression line should be displayed on the plot. Defaults to TRUE. |
lmcolor |
designates the color of the linear regression line. Defaults to "black". |
lmsize |
designates the size of the linear regression line. Defaults to 1. |
lmtype |
designates the type of the linear regression line. Defaults to 2. |
includestats |
a logical indicating whether the R-squared and p-value statistics text should be displayed on the plot. Defaults to TRUE. |
statstable |
a logical indicating whether a .csv of trend statistics should be saved. Defaults to TRUE. |
maxpvalue |
a numeric indicating the maximum p-value limit for a species' CPUE trend to be included in the export. Any species' CPUE trends with a p-value above this number will not be exported. Defaults to 0.1. |
.png plots and statistics .csv
Other Fish:
fishabbrev2common()
,
fishabbrev2scientific()
,
fishcommon2abbrev()
,
fishcommon2scientific()
,
fishscientific2abbrev()
,
fishscientific2common()
,
fishspeciesmetadata
,
fishsurveydata()
,
fishtable()
,
fishtrendstats()
,
lakefinderdownload()
## Not run:
#Download the data
x <- lakefinderdownload("21005700")
#Select fisheries survey data
y <- fishsurveydata(
lakefinderdata = x
)
#Extract appropriate data for each fish species
z <-fishtable(
fishsurvey = y,
fishspecies = c("Bluegill","Largemouth Bass"))
fishtrendplots(plotdata = z)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.