lk-methods: resample

Description Usage Arguments Value Examples

Description

Resamples from a distribution to generate a frequency table

Simulates a normal density function from an FLQuant

Usage

1
  mixnorm(mn, sd, bin, left = T)

Arguments

object

an FLQuant

dim

dimensions of FLQuant to sample within, i.e. if equal to 2 then sampling is within year

size

sum of frequency disribution

replace

sample with replacement?, defaults to FALSE only useful if values in object are integers

mn

an FLQuant with means

sd

an FLQuant with standard deviation

Value

a FLQuant with simulated frequency distribution

an FLPar with expected probability for lengths-at-age

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
  library(FLCore)
  data(ple4sex)

  apply(resample(catch.n(ple4sex)[,1:4],2,  100),2,  sum)
  apply(resample(catch.n(ple4sex)[,1:4],2:3,100),2:3,sum)
  apply(resample(catch.n(ple4sex)[,1:4],1:2,100),1:2,sum)
  
## End(Not run)
## Not run: 
mn=FLQuant( 1:5,     dimnames=list(age=1:5,year=1991:2000,unit=1:2))
sd=FLQuant((1:5)/10,dimnames=list(age=1:5,year=1991:2000))
md=mixnorm(mn,sd,(1:20)/4)
ggplot(as.data.frame(dat))+geom_line(aes(len,data,group=age))+facet_wrap(year~unit)
 
## End(Not run)

ejardim/FLMethLen documentation built on May 16, 2019, 2:22 a.m.