RFBCoptions: See or set arguments for common RFishBC functions

View source: R/RFBCoptions.R

RFBCoptionsR Documentation

See or set arguments for common RFishBC functions

Description

The digitizeRadii and showDigitizedImage functions have a variety of arguments that create great flexibility. Default values for these arguments can be seen with this function.

Additionally, a user may want to change a number of these arguments from their default values and use those new values in a large number of function calls (e.g., processing a larger number of structures with the same characteristics). Changing the argument values from the defaults during each function call is inefficient. Thus, default values for these arguments may be changed for the SESSION with this function.

Usage

RFBCoptions(reset = FALSE, ...)

Arguments

reset

A logical that will reset the values to their “factory-fresh” defaults if TRUE.

...

An arbitrary number of argument=value pairs where argument is one of the argument names and value is the new value for the argument. See details and examples.

Details

The arguments that can be set with this function are:

  • reading: A single character string (or an object that can be coerced to a character) that identifies the reading for a structure. If the structure will be read multiple times, then this may be used to specify the particular reading. Defaults to NULL. Used in digitizeRadii.

  • description: A single character string that contains a short (but more detailed than in reading) description for a reading of a structure. Defaults to NULL. Used in digitizeRadii.

  • suffix: A single character string that will be added to the RData file name. If NULL and reading is not NULL, then this will be replaced with the value in reading. Defaults to NULL. Used in digitizeRadii.

  • edgeIsAnnulus: A single logical that indicates whether the structure margin should be considered an annulus (TRUE) or not (FALSE). Use FALSE if growth between the last annulus and the structure margin is not a complete year's worth of growth (i.e., “plus-growth”). Defaults to NULL which means that the user must set this value. Used in digitizeRadii.

  • windowSize: A single numeric used to set the size of the largest dimension for the window in which the structure image is opened. This size will be the width for wider images and the height for taller images. The other dimension will be set relative to this so that the image is displayed in its native aspect ratio. Defaults to 7 inches. Used in digitizeRadii and findScalingFactor.

  • deviceType: A single character that identifies the type of graphic device in which the image will be shown. Defaults to deviceType="windows" which should be used with a Windows OS, but can be set to deviceType="X11" which should be used with a Mac OS.

  • popID: A single logical that indicates if the fish ID dialog box (only on Windows if no ID is given in digitizeRadii) is populated with a guess at the fish ID. The guess is from using the pattern in IDpattern (see below) on the image file name sans the extension. This may be useful for when the image name contains the fish ID (and no other numbers). Defaults to TRUE. Used in digitizeRadii.

  • IDpattern: A single regular expression that indicates how to extract a possible fish ID from an image file name. Defaults to selecting all characters after the last underscore in the image file name (sans extension). Used in digitizeRadii and getID.

  • IDreplace: A string to replace the expression matched in IDpattern. Used in digitizeRadii and getID.

  • scalingFactor: A single numeric used to convert measurements on the structure image to actual measurements on the structure. Measurements on the structure image will be multiplied by this value. Ignored if scaleBar=TRUE. Defaults to 1. Used in digitizeRadii.

  • scaleBar: A single logical that indicates whether the user will be prompted to select the endpoints of a scale-bar on the structure image. If TRUE, then must also use scaleBarLength. If FALSE, then consider using scalingFactor. Defaults to FALSE. Used in digitizeRadii.

  • scaleBarLength: A single numeric that represents the actual length of the scale-bar. Ignored if scaleBar=FALSE. Defaults to NULL; thus, the user must enter a value if scaleBar=TRUE. Used in digitizeRadii.

  • scaleBarUnits: A single character that represents the units of measurement for the actual length of the scale-bar. Ignored if scaleBar=FALSE. Defaults to NULL; thus, the user must enter a value if scaleBar=TRUE. Used in digitizeRadii.

  • col.scaleBar: The color of the scale-bar line if scalebar=TRUE. Defaults to "yellow". Used in digitizeRadii, showDigitizedImage, and findScalingFactor.

  • lwd.scaleBar: The line width of the scale-bar line if scalebar=TRUE. Defaults to 2. Used in digitizeRadii, showDigitizedImage, and findScalingFactor.

  • showScaleBarLength: A single logical that indicates whether the length of the scale-bar line should be shown on the image. Used in showDigitizedImage.

  • makeTransect: A single logical that indicates whether a transect between the points selected at the structure center and margin should be made. Defaults to TRUE. Used in digitizeRadii.

  • snap2Transect: A single logical that indicates whether the coordinates of the selected points that represent annuli should be moved to fall exactly on the transect from the structure center to margin. If TRUE then the points will be moved perpendicularly to the transect (and the original user-selected point will not be seen on the image). If FALSE then the points will be where the user selected them. Defaults to TRUE. Used in digitizeRadii.

  • col.transect: The color of the transect line if makeTransect=TRUE in digitizeRadii. Defaults to "cyan".

  • lwd.transect: The width of the transect line if makeTransect=TRUE in digitizeRadii. Defaults to 2.

  • connect: A single logical that indicates whether the selected points should be connected with a line. Defaults to TRUE. Used in showDigitizedImage.

  • col.connect: The color of the connecting line if connect=TRUE in showDigitizedImage. Defaults to "cyan".

  • lwd.connect: The width of the connecting line if connect=TRUE in showDigitizedImage. Defaults to 2.

  • pch.sel: The plotting character of points for selected annuli in digitizeRadii. Defaults to 20 (a small solid circle).

  • col.sel: The color of points for selected annuli in digitizeRadii. Defaults to "yellow".

  • cex.sel: The character expansion value of points for selected annuli in digitizeRadii. Defaults to 1.

  • pch.del: The plotting character of points for DEselected annuli in digitizeRadii. Defaults to 13 (a circle with an X in it).

  • col.del: The color of points for DEselected annuli in digitizeRadii. Defaults to "red".

  • pch.show: The plotting character for points shown in showDigitizedImage. Defaults to 19 (a solid circle).

  • col.show: The color of points shown in showDigitizedImage. Defaults to "yellow".

  • cex.show: The character expansion value of points shown in showDigitizedImage. Defaults to 1.

  • showInfo: A single logical that indicates whether the ID information should be shown on the image in digitizeRadii. Defaults to TRUE.

  • pos.info: A single character that indicates where the ID information should be placed when showInfo=TRUE. See legend for position choices. Defaults to "topleft". Used in digitizeRadii.

  • cex.info: The character expansion for the ID information when showInfo=TRUE. Defaults to 1.2 Used in digitizeRadii.

  • col.info: The color for the ID information when showInfo=TRUE. Defaults to "yellow". Used in digitizeRadii.

  • showAnnuliLabels: A single logical that indicates whether annulus labels should be shown on the image from showDigitizedImage. Defaults to TRUE, but is ignored if more than one set of annuli will be plotted.

  • annuliLabels: A numeric vector that indicates the numbers for which annuli should be labeled when showAnnuliLabels=TRUE. Defaults to NULL which indicates that all annuli should be labeled. Used in showDigitizedImage.

  • col.ann: The color of the annuli number text when showAnnuliLabels=TRUE in showDigitizedImage. Defaults to "yellow".

  • cex.ann: The character expansion value of the annuli number text when showAnnuliLabels=TRUE in showDigitizedImage. Defaults to 1.2.

  • offset.ann: A numeric value that specifies the offset (in proportions of a character width) of the annuli labels from the point when showAnnuliLabels=TRUE in showDigitizedImage. Defaults to 0.5.

  • addNote: A logical for whether the user can add or will be prompted to add a special note to the RData file when using digitizeRadii. Example notes may indicate that the image was poor, some annuli were suspect, or the image should be re-read.

The user will likely only use this function to change arguments at the start of a script, so that those values will be used throughout the analyses in the script. If the values for the arguments need to be changed in any instance of digitizeRadii or showDigitizedImage, then it is more efficient to change the argument within the call to those functions.

The argument values can be reset to the original defaults by using reset=TRUE. See examples.

Value

None, but the list in RFBCoptions will be modified.

Author(s)

Derek H. Ogle, derek@derekogle.com

See Also

digitizeRadii and showDigitizedImage

Examples

## Show all options
RFBCoptions()

## Show how to see and set one option
RFBCoptions()$makeTransect
RFBCoptions(makeTransect=FALSE)
RFBCoptions()$makeTransect
RFBCoptions(reset=TRUE)
RFBCoptions()$makeTransect

## Multiple options can also be set at once
RFBCoptions(pch.show=3,col.show="blue",cex.show=3)


RFishBC documentation built on Aug. 29, 2023, 9:06 a.m.

Related to RFBCoptions in RFishBC...