knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This vignette suggests a workflow for back-calculating fish length at a previous age from measurements made to annuli on a calcified structure. This vignette assumes that you have a general understanding of the purpose and methods of back-calculation as described in the Short Introduction to Back-Calculation vignette.
Create a folder/directory for all files created below.
Create a data file that contains all pertinent information about each individual fish to be examined.
Obtain quality digital images of calcified structures on which annuli can be identified.
Start (and save) an R script.
library(RFishBC)
.RFishBC
package.library(dplyr)
.setwd()
to set the working directory to where the script and structure images are saved as described in the "Static Structure Images" section of the Collecting Radii Data vignette.(OPTIONAL) Use findScalingFactor()
with the image of an object of known length at a specific magnification to derive an appropriate scaling factor for converting image pixels to actual lengths on the structure.
(OPTIONAL, BUT SUGGESTED) Use RFBCoptions()
as described in the "Setting Argument Defaults for a Session" section of the Collecting Radii Data vignette to set options used by digitizeRadii()
for all images to be digitized during the session.
reading
; description
; suffix
; edgeIsAnnulus
; and scalingFactor
or scaleBar
and scaleBarLength
. Descriptions for each option are in the documentation for RFishBC()
.Use digitizeRadii()
to mark annuli on a structure image as described in the "Measure Radii" section of the Collecting Radii Data vignette.
(OPTIONAL, AS NEEDED) Examine the selected annuli with showDigitizedImage()
as described in the "Visualize One Set of Annuli" section of the Visualize Radii Data vignette.
Repeat the previous two steps for each structure in the working directory. Note that digitizeRadii()
can accept more than one image name to streamline the processing of many images. The use of multiple image names is described in "Processing Multiple Images" section of the Collecting Radii Data vignette.
Use combineData()
to combine the radial measurements from all analyzed images into a data.frame as described in the "Combine Data from Multiple Structures" section of the Collecting Radii Data vignette.
Use write.csv()
to write the data.frame from the previous step to an external CSV file as described in the "Output Data File" sections of the Collecting Radii Data vignette.
Back-calculate lengths at previous ages as described in the Compute Back-Calculated Lengths vignette.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.