Load librarys

Read in tree lists from different fire intensity class runs

Sophie: You’ll need to reset this to your relative path in GDrive

ID.All <- read.csv("/Users/kdw223/Library/CloudStorage/GoogleDrive-katharyn@vibrantplanet.net/Shared drives/VP - Science Group/projects/Biodiversity/Sugarpine/SARAs and RFs/beavers/data-raw/veg-classification/TreeMap-Inputs/rf/ID/fire/ID-StdStk-timeseries.csv")

Check species present

species=unique(ID.All$Species)

Change in relative abundance of ponderosa pine

filter for ponderosa pine: species code PIPO

PIPO=ID.All%>%
  filter(Species=="PIPO")

PIPO=PIPO%>%
  group_by(MgmtID, Year, LiveBA)%>%
  summarise()
## `summarise()` has grouped output by 'MgmtID', 'Year'. You can override using
## the `.groups` argument.

For RF’s only: Filter for year 2035, 10 years post disturbance

PIPO=PIPO%>%
  filter(Year==2035)
pipo.plot=plot_ly(data = PIPO, x = ~ MgmtID, y = ~ LiveBA, type = 'box', color = ~ MgmtID)
  
pipo.plot

Calculate stats, generate RF:

Stat.PIPO = get_summary_stats(PIPO)
PIPO.RF=Stat.PIPO%>%
  mutate(RF.mean=(mean-mean[1])/mean[1])%>%
  mutate(RF.rd=round(RF.mean, digits = 3))

View RF table:

knitr::kable(PIPO.RF)
MgmtID Year variable n min max median q1 q3 iqr mad mean sd se ci RF.mean RF.rd
BASE 2035 LiveBA 2520 0.223 193.055 21.909 9.781 43.918 34.137 21.730 33.621 34.293 0.683 1.340 0.0000000 0.000
FIC1 2035 LiveBA 2515 0.000 169.225 15.854 6.668 32.223 25.555 16.526 25.350 28.167 0.562 1.101 -0.2460070 -0.246
FIC2 2035 LiveBA 2520 0.001 187.259 18.116 8.195 34.934 26.739 17.688 27.252 27.885 0.555 1.089 -0.1894352 -0.189
FIC3 2035 LiveBA 2467 0.000 168.017 8.184 2.264 21.814 19.550 10.416 18.852 27.515 0.554 1.086 -0.4392790 -0.439
FIC4 2035 LiveBA 2303 0.000 163.172 3.297 0.832 13.922 13.090 4.513 12.887 23.159 0.483 0.946 -0.6166979 -0.617
FIC5 2035 LiveBA 1982 0.000 154.388 1.283 0.412 7.369 6.957 1.671 6.845 13.457 0.302 0.593 -0.7964070 -0.796
FIC6 2035 LiveBA 1982 0.000 21.242 0.706 0.316 1.304 0.988 0.677 1.047 1.393 0.031 0.061 -0.9688587 -0.969