Commit 59f49844 authored by patrick.lambert's avatar patrick.lambert
Browse files

bug fixed and computation over 15 years

parent e35f64af
......@@ -184,8 +184,8 @@ Stich2020_sel <- read_csv("../NEA_calibration_offline/Stich_Table 9.csv") %>%
mutate(L0_theo = vonBertalanffyLengthAtHatch(Linf, K, t0))
#create a data frame and compute L at age with values from Stich
growthInOffshore <- expand_grid(basin_name = nea_riverBasinFeatures$basin_name , age = seq(0,9.75,.25)) %>%
mutate(season = case_when (
growthInOffshore <- expand_grid(basin_name = nea_riverBasinFeatures$basin_name , age = seq(0,14.75,.25)) %>%
mutate(season = case_when(
(age - floor(age)) == 0.00 ~ 'spring',
(age - floor(age)) == 0.25 ~ 'summer',
(age - floor(age)) == 0.50 ~ 'fall',
......@@ -201,18 +201,18 @@ growthInOffshore <- expand_grid(basin_name = nea_riverBasinFeatures$basin_name ,
mutate(LStich = vonBertalanffyGrowth(age, L0_theo, Linf, K) / 10) %>% # in cm
ungroup()
growthInOffshore <-growthInOffshore %>%
growthInBasin <-growthInOffshore %>%
inner_join(tempEffectInOffshore,
by = c("basin_name" = "inshore_basin_name", "season")) %>%
right_join(tempEffectInFreshWat,
by = c("basin_name","season"))
growthInOffshore <- growthInOffshore %>%
mutate(temperature = ifelse(season == "spring" & age == 0, temperature_RI,
growthInBasin <- growthInBasin %>%
mutate(temperature_RIO = ifelse(season == "spring" & age == 0, temperature_RI,
ifelse(season == "summer" & age == 0.25, temperature_RI,
ifelse(season == "fall" & age == 0.50, temperature_RI, temperature_O)))) %>%
arrange(basin_name,age,season) %>%
select(basin_name, offshore_basin_name, metapop,age, season, temperature_O, LStich)
select(basin_name, offshore_basin_name, metapop,age, season, temperature_O, temperature_RIO, LStich)
#group_by(metapop,age,season) %>%
#summarize(LStich = unique(LStich))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment