Skip to content

Commit

Permalink
copy and source() the newsbss locally
Browse files Browse the repository at this point in the history
better to have a static version as this might change later, and for ease of others' use
  • Loading branch information
mkapur-noaa committed Apr 10, 2024
1 parent 0aa47e4 commit 9ef3e55
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
17 changes: 17 additions & 0 deletions 2024/R/BIN_AGE_DATA.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# adapted/generalized from Steve Barbeaux' files for
# generating SS files for EBS/AI Greenland Turbot
# ZTA, 2013-05-08, R version 2.15.1, 32-bit

BIN_AGE_DATA <- function(data,age_bins=seq(1,100,1))
{
age<-data.frame(AGE=c(1:max(data$AGE)))
age$aBIN<-max(age_bins)
n<-length(age_bins)
for(i in 2:n-1)
{
age$aBIN[age$AGE < age_bins[((n-i)+1)] ]<-age_bins[n-i]
}
data<-merge(data,age,all.x=T,all.y=F)
data
}

17 changes: 17 additions & 0 deletions 2024/R/BIN_LEN_DATA.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# adapted/generalized from Steve Barbeaux' files for
# generating SS files for EBS/AI Greenland Turbot
# ZTA, 2013-05-08, R version 2.15.1, 32-bit

BIN_LEN_DATA <- function(data,len_bins=seq(1,100,1))
{
length<-data.frame(LENGTH=c(1:max(data$LENGTH)))
length$BIN<-max(len_bins)
n<-length(len_bins)
for(i in 2:n-1)
{
length$BIN[length$LENGTH < len_bins[((n-i)+1)] ]<-len_bins[n-i]
}
data<-merge(data,length,all.x=T,all.y=F)
data
}

5 changes: 2 additions & 3 deletions 2024/R/old_fishery_lcomp_routine.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ username_AKFIN <- showPrompt(title="Username", message="Enter your AKFIN usernam
password_AKFIN <- askForPassword(prompt="Enter your AKFIN password:")
AKFIN <- odbcConnect("AKFIN",username_AKFIN,password_AKFIN, believeNRows = FALSE)


source("C:/USERS/MAIA.KAPUR/WORK/ASSESSMENTS/NEWSBSS/FUNCTIONS/BIN_LEN_DATA.R")
source("C:/USERS/MAIA.KAPUR/WORK/ASSESSMENTS/NEWSBSS/FUNCTIONS/BIN_AGE_DATA.R")
source(here::here(year,'R','BIN_LEN_DATA.R'))
source(here::here(year,'R','BIN_AGE_DATA.R'))
## Flathead sole only = 103, Rex = 105, Dover = 107, Bering flounder = 145, GT = 102, Deepsea sole = 110
## Setup options for flathead sole in BSAI
final_year <- 2024
Expand Down

0 comments on commit 9ef3e55

Please sign in to comment.