Skip to content

Commit

Permalink
Merge pull request #16 from mcolvin/referance-to-individual
Browse files Browse the repository at this point in the history
Referance to individual
  • Loading branch information
mcolvin committed Jun 8, 2017
2 parents d545e92 + e6849d1 commit 326b353
Show file tree
Hide file tree
Showing 5 changed files with 1,417 additions and 559 deletions.
72 changes: 59 additions & 13 deletions CPUE.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ rmarkdown::render("index.Rmd")

```{r,echo=FALSE,warning=FALSE, message=FALSE}
source("R/1_global.R")
source("R/2_functions.R")
# source("R/3_load-and-clean.R")
source("R/2_functions-2.R")
source("R/3_load-and-clean.R")
source("R/4_figures.R")
source("R/5_tables.R")
source("R/6-analysis-CPUE.R")
Expand All @@ -34,21 +34,63 @@ nyears<- 10
beta0<- 2.9444
phi<-matrix(plogis(beta0),length(segs),nyears-1)
fish_density<- 10
```

#SAMPLING OUTPUT
segs<- c(1,2,3,4,7,8,9,11,10,13,14)
nyears<- 10

beta0<- 2.9444
phi<-matrix(plogis(beta0),length(segs),nyears-1)

sim_pop<-reference_population(segs=segs,
bends=bends,# BENDS DATAFRAME
fish_density=10, # FISH DENSITY PER RKM
phi=phi) # MATRIX OF YEAR TO YEAR AND SEGEMENT SPECIFIC SURVIVALS
yyy<-catch_counts(segs=c(1,2,3,4,7,8,9,10,13,14),
bends=sim_pop$bendMeta,
abund=sim_pop$Z,
gears=c("GN14", "GN18", "GN41", "GN81",
"MF", "OT16", "TLC1", "TLC2", "TN"),
catchability=c(0.00004, 0.00004, 0.00004,
0.00004, 0.00004, 0.0002, 0.00004, 0.00004, 0.0002),
deployments=rep(8,9),
effort=effort,
occasions=3)
# returns list of values
yyyy<- bend_samples(segs=c(1,2,3,4,7,8,9,10,13,14),
bends=bends,
abund=sim_pop$out)
yyyyy<-samp_dat(segs=c(1,2,3,4,7,8,9,10,13,14),
bends=bends,
bend_abund=sim_pop$out,
ind_abund=sim_pop$Z,
gears=c("GN14", "GN18", "GN41", "GN81", "MF",
"OT16", "TLC1", "TLC2", "TN"),
catchability=c(0.00004, 0.00004, 0.00004, 0.00004,
0.00004, 0.0002, 0.00004, 0.00004, 0.0002),
deployments=rep(8,9),
effort=effort,
occasions=3)
names(yyyyy)
# yyyyy$cpue_long this can feed the beast below
head(yyyyy$cpue_long)
trnd_dat<-get.trnd(segs=segs,
bends=bends,# BENDS DATAFRAME
abund=sim_pop$out,
abund=sim_pop$out,
gears=c("GN14", "GN18", "GN41", "GN81", "MF", "OT16", "TLC1", "TLC2", "TN"),
catchability=c(0.00004, 0.00004, 0.00004, 0.00004, 0.00004, 0.002, 0.00004, 0.00004, 0.002), #BY GEAR,
deployments=rep(8,9), #BY GEAR
effort=effort)
trnd_dat<-do.call("rbind",trnd_dat)
# CPUE ANALYSIS FOR TREND
tmp<- aggregate(cpue~year+segment,sim_dat,mean)
tmp$segment<- as.factor(tmp$segment)
Expand Down Expand Up @@ -86,7 +128,11 @@ sim_pop<-reference_population(segs=segs,
bends=bends,# BENDS DATAFRAME
fish_density=10, # FISH DENSITY PER RKM
phi=phi) # MATRIX OF YEAR TO YEAR AND SEGEMENT SPECIFIC SURVIVALS

tmp<-bend_samples(segs=c(1,2,3,4,7,8,9,10,13,14),
bends=bends,
abund=sim_pop$out)
trnd_dat<-get.trnd(segs=segs,
bends=bends,# BENDS DATAFRAME
abund=sim_pop$out,
Expand Down
Loading

0 comments on commit 326b353

Please sign in to comment.