Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
sghosh89 committed May 12, 2024
1 parent ea54fe4 commit 30133f2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
17 changes: 9 additions & 8 deletions R/phylopath_sig75_0-250km.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ g3 # Write the grid.arrange in the file
dev.off()

#============== model ===========
call_phylopath_sig75_0_250km<-function(model, df){
call_phylopath_sig75_0_250km<-function(model, df, ct3){

#-------------------------------
model_tas5_abs_td<-define_model_set(
Expand Down Expand Up @@ -157,12 +157,13 @@ call_phylopath_sig75_0_250km<-function(model, df){
modres_HWI_T_only<- phylo_path(modelsHWI_Tonly, data = df,
tree = ct3,
model = 'lambda')

saveRDS(modres_HWI_T_only,here(paste(myresloc,"model_est.RDS",sep="/")))
modsum<-summary(modres_HWI_T_only)
print(modsum)
gp3<-plot(modsum)+theme_classic()
best_model_T <- best(modres_HWI_T_only, boot=1000)
print(best_model_T)
saveRDS(best_model_T,here(paste(myresloc,"best_model_est.RDS",sep="/")))
gp1<-plot(best_model_T, curvature=0.1, edge_width = 3)
gp2<-coef_plot(best_model_T)+ggplot2::theme_bw()

Expand All @@ -174,12 +175,12 @@ call_phylopath_sig75_0_250km<-function(model, df){
}

#=========================
call_phylopath_sig75_0_250km(model="tas5_abs_td", df=df)
call_phylopath_sig75_0_250km(model="pr5_abs_td", df=df)
call_phylopath_sig75_0_250km(model="tas5_abs_td", df=df, ct3=ct3)
call_phylopath_sig75_0_250km(model="pr5_abs_td", df=df, ct3=ct3)

call_phylopath_sig75_0_250km(model="tas5", df=df)
call_phylopath_sig75_0_250km(model="pr5", df=df)
call_phylopath_sig75_0_250km(model="tas5", df=df, ct3=ct3)
call_phylopath_sig75_0_250km(model="pr5", df=df, ct3=ct3)

call_phylopath_sig75_0_250km(model="tas", df=df)
call_phylopath_sig75_0_250km(model="pr", df=df)
call_phylopath_sig75_0_250km(model="tas", df=df, ct3=ct3)
call_phylopath_sig75_0_250km(model="pr", df=df, ct3=ct3)

6 changes: 6 additions & 0 deletions R/phylopath_sig95_0-100km.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,10 @@ call_phylopath_sig95_0_100km<-function(model, df){
call_phylopath_sig95_0_100km(model="tas5_abs_td", df=df)
call_phylopath_sig95_0_100km(model="pr5_abs_td", df=df)

# later can't run because of drastic drop in sample size!
#call_phylopath_sig95_0_100km(model="tas5", df=df)
#call_phylopath_sig95_0_100km(model="pr5", df=df)

#call_phylopath_sig95_0_250km(model="tas", df=df)
#call_phylopath_sig95_0_250km(model="pr", df=df)

13 changes: 9 additions & 4 deletions R/phylopath_sig95_0-250km.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ g3 # Write the grid.arrange in the file
dev.off()

#============== model ===========
call_phylopath_sig95_0_250km<-function(model, df){
call_phylopath_sig95_0_250km<-function(model, df, ct3){

#-------------------------------
model_tas5_abs_td<-define_model_set(
Expand Down Expand Up @@ -157,12 +157,13 @@ call_phylopath_sig95_0_250km<-function(model, df){
modres_HWI_T_only<- phylo_path(modelsHWI_Tonly, data = df,
tree = ct3,
model = 'lambda')

saveRDS(modres_HWI_T_only,here(paste(myresloc,"model_est.RDS",sep="/")))
modsum<-summary(modres_HWI_T_only)
print(modsum)
gp3<-plot(modsum)+theme_classic()
best_model_T <- best(modres_HWI_T_only, boot=1000)
print(best_model_T)
saveRDS(best_model_T,here(paste(myresloc,"best_model_est.RDS",sep="/")))
gp1<-plot(best_model_T, curvature=0.1, edge_width = 3)
gp2<-coef_plot(best_model_T)+ggplot2::theme_bw()

Expand All @@ -174,8 +175,12 @@ call_phylopath_sig95_0_250km<-function(model, df){
}

#=========================
call_phylopath_sig95_0_250km(model="tas5_abs_td", df=df)
call_phylopath_sig95_0_250km(model="pr5_abs_td", df=df)
call_phylopath_sig95_0_250km(model="tas5_abs_td", df=df, ct3=ct3)
call_phylopath_sig95_0_250km(model="pr5_abs_td", df=df, ct3=ct3)

call_phylopath_sig95_0_250km(model="tas5", df=df, ct3=ct3)
call_phylopath_sig95_0_250km(model="pr5", df=df, ct3=ct3)

call_phylopath_sig95_0_250km(model="tas", df=df, ct3=ct3)
call_phylopath_sig95_0_250km(model="pr", df=df, ct3=ct3)

3 changes: 3 additions & 0 deletions R/phylopath_sig95_100-250km.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ call_phylopath_sig95_100_250km<-function(model, df){
call_phylopath_sig95_100_250km(model="tas5_abs_td", df=df)
call_phylopath_sig95_100_250km(model="pr5_abs_td", df=df)

# low sample size
#call_phylopath_sig95_100_250km(model="tas5", df=df)
#call_phylopath_sig95_100_250km(model="pr5", df=df)



0 comments on commit 30133f2

Please sign in to comment.