Skip to content

Commit

Permalink
rounding only the SHI end-result
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlord committed Jun 14, 2024
1 parent 5ede09d commit 6d80bbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/SHI/scp_SHI_03_HabitatChange_GFW.R
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ for(i in 1:length(sp)){


#------------------------ 3.1.3. SHS -------------------------------------------
df_SHS_gfw <- data.frame(sci_name=sp[i], AS=round(as.numeric(df_area_score_gfw$percentage),2),CS=round(df_conn_score_gfw$percentage),2)
df_SHS_gfw <- data.frame(sci_name=sp[i], AS=as.numeric(df_area_score_gfw$percentage),CS=df_conn_score_gfw$percentage)
print(df_SHS_gfw)
df_SHS_gfw <- df_SHS_gfw |> dplyr::mutate(SHS=(AS+CS)/2, info="GFW", Year=v_time_steps)
print(df_SHS_gfw)
Expand Down
2 changes: 1 addition & 1 deletion scripts/SHI/scp_SHI_04_CalcSHI.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ df_SHS_aoh_areas_sp <- df_SHS_sp |> filter(Score=="SHS") |> left_join(df_aoh_are
# Calculate SHI
#-------------------------------------------------------------------------------

df_SHI <- df_SHS_aoh_areas_sp |> group_by(Year) |> summarise(SHI=mean(Values),Steward_SHI= weighted.mean(Values,W_stewardship))
df_SHI <- df_SHS_aoh_areas_sp |> group_by(Year) |> summarise(SHI=round(mean(Values),2),Steward_SHI= round(weighted.mean(Values,W_stewardship),2))
path_SHI <- file.path(outputFolder,"SHI_table.tsv")
print(df_SHI)
write_tsv(df_SHI,file= path_SHI)
Expand Down

0 comments on commit 6d80bbe

Please sign in to comment.