exec/overall_mortality_results.R

tbl1 <- MakePlotCountTable(by = 'section', csv = F)
print(tbl1)
tbl2 <- MakePlotCountTable(by = 'forest_type', csv = F)
print(tbl2)

PlotMortBoxplot(plot_type = 'all', by = 'forest_type', drop_NA = F, zero_as_NA = F)
#PlotMortBoxplot(plot_type = 'all', by = 'forest_type', drop_NA = F, zero_as_NA = T)
PlotMortBoxplot(plot_type = 'diff', by = 'forest_type', drop_NA = F, zero_as_NA = F)
PlotMortBoxplot(plot_type = 'fire', by = 'forest_type', drop_NA = F, zero_as_NA = T)
PlotMortBoxplot(plot_type = 'log', by = 'forest_type', drop_NA = F, zero_as_NA = T)
PlotMortBoxplot(plot_type = 'insect', by = 'forest_type', drop_NA = F, zero_as_NA = T)
PlotMortBoxplot(plot_type = 'non_fire', by = 'forest_type', drop_NA = F, zero_as_NA = F)

# Multi-panel:

p1 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Douglas-fir', clear_plots = F)
p2 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Ponderosa pine', clear_plots = F)
p3 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Pinyon / juniper woodland', clear_plots = F)
p4 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Aspen', clear_plots = F)
p5 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'California mixed conifer', clear_plots = F)
p6 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Lodgepole pine', clear_plots = F)
p7 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Engelmann spruce / subalpine fir', clear_plots = F)
p8 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Grand fir', clear_plots = F)
p9 <- PlotMortBoxplot(plot_type, by = 'mort_type', drop_NA = F, zero_as_NA = F,
                      ftype = 'Deciduous oak woodland', clear_plots = F)
Multiplot(p1, p2, p3, p4, p5, p6, p7, p8, p9, cols = 3)


PlotMortBoxplot(plot_type = 'all', drop_NA = F, zero_as_NA = F)
# all samples:
PlotMortBoxplot(plot_type = 'all', drop_NA = F, zero_as_NA = T)
# 70.75% of plots, 3367 removed
PlotMortBoxplot(plot_type = 'fire', drop_NA = F, zero_as_NA = T)
# 6.94% of plots, 10711 removed
PlotMortBoxplot(plot_type = 'log', drop_NA = F, zero_as_NA = T)
# 10.40% of plots, 10313 removed
PlotMortBoxplot(plot_type = 'insect', drop_NA = F, zero_as_NA = T)
# 21.69% of plots, 9013 removed
PlotMortBoxplot(plot_type = 'non_fire', drop_NA = F, zero_as_NA = T)
# 69.89% of plots, 3466 removed
PlotMortBoxplot(plot_type = 'diff', drop_NA = F, zero_as_NA = T)
# 55.3% of plots, 5145 removed
# i.e. over half of plots had mortality from non-fire/log/insect sources
PlotMortBoxplot(plot_type = 'diff', drop_NA = F, zero_as_NA = F)
PlotMortBoxplot(plot_type = 'non_harvest', drop_NA = F, zero_as_NA = F,
                IQR_outliers = F, IQR_type = 'high')


SummarizeAndPlotZeroMortPlotsBySection() # for plot
zero_plot_summary <- SummarizeAndPlotZeroMortPlotsBySection(agg = T) # for dataframe return
print(zero_plot_summary)

PlotMortBoxplot(plot_type = 'all', by = 'province', drop_NA = F, zero_as_NA = F)
PlotMortBoxplot(plot_type = 'all', by = 'forest_type', drop_NA = F, zero_as_NA = F)

plot0 <- PlotMortBoxplot(plot_type = 'all', IQR_outliers = T, IQR_type = 'high',
                drop_NA = F, zero_as_NA = F)
plot1 <- PlotMortBoxplot(plot_type = 'all', IQR_outliers = T, IQR_type = 'background',
                drop_NA = F, zero_as_NA = F)
bmcUtils::Multiplot(plot0, plot1)

PlotMortBoxplot(plot_type = 'log', drop_NA = F, zero_as_NA = T,
                IQR_outliers = T, IQR_type = 'high')
PlotMortBoxplot(plot_type = 'fire', drop_NA = F, zero_as_NA = T,
                IQR_outliers = T, IQR_type = 'high')
PlotMortBoxplot(plot_type = 'insect', drop_NA = F, zero_as_NA = F,
                IQR_outliers = T, IQR_type = 'high')
PlotMortBoxplot(plot_type = 'non_harvest', drop_NA = F, zero_as_NA = F,
                IQR_outliers = F, IQR_type = 'high')

PlotMortBoxplot(plot_type = 'all', IQR_outliers = T, IQR_type = 'background',
                drop_NA = F, zero_as_NA = F)
PlotMortBoxplot(plot_type = 'diff', IQR_outliers = T, IQR_type = 'background',
                drop_NA = F, zero_as_NA = F)

plot(FIA_mortality_with_explanatory$ALSTKCD[which(FIA_mortality_with_explanatory$forest_type == 'Douglas-fir')],
     FIA_mortality_with_explanatory$mort_rate[which(FIA_mortality_with_explanatory$forest_type == 'Douglas-fir')])
bmcnellis/RSFIA documentation built on June 1, 2019, 7:40 a.m.