simAgeBias: Simulate an age bias and simulate the ages of fish using the...

Description Usage Arguments Details Value See Also Examples

View source: R/simAgeBias.R

Description

Constructs an age-bias table interactively. This age-bias table can then be used to convert the true ages of a sample of fish to ‘biased’ ages.

Usage

1
2
3
simAgeBias(max.age = 10, show.props = TRUE, scale = TRUE)

simApplyAgeBias(ages, bias.table = NULL, agree.table = NULL)

Arguments

max.age

A numeric indicating the maximum age to be modelled in the age bias table.

show.props

A logical indicating whether proportions of fish at x-axis age or numbers of fish should be shown on the interactive plot (=TRUE; default) or not.

scale

A logical indicating whether the plotted value of the proportions or numbers should be scaled in relation to their numeric value (=TRUE; default) or not.

ages

A vector containg the ‘true’ ages of individual fish.

bias.table

A table that contains, as columns, the proportion of fish of a certain ‘true’ age in various ‘biased’ ages – i.e., a column-proportions table constructed from an age agreement table where the ‘true’ ages correspond to columns.

agree.table

A table that contains the age-agreement table where the ‘true’ ages correspond to columns.

Details

NEED DETAIL HERE.

Value

If simApplyAgeBias is used then a vector of ‘biased’ ages is returned. If simAgeBias is used then a list with the following two items is returned:

See Also

See simAges for related functionality and ageBias and agePrecision in FSA for analyzing this type of data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## set seed for repeatability
set.seed(5234734)

## Simulated individual ages (random)
#    see simAges functions
bg.ages <- simAges(N0=500,A=0.35)
summary(bg.ages)

## Simulated ages given the above 'true' ages and age biases from interactive choices
#  NOT RUN because of interactive choices
## Not run: 
bg.ab <- simAgeBias(max.age=max(bg.ages))
bg.ages2 <- simApplyAgeBias(bg.ages,bg.ab$bias)
summary(bg.ages2)

## End(Not run)

droglenc/FSAsim documentation built on Feb. 15, 2020, 11:20 p.m.