library(flexdashboard)
knitr::opts_chunk$set(cache=FALSE, tidy=TRUE, message=FALSE, warning=FALSE, fig.showtext=TRUE, dev="CairoPNG",
                      fig.width = 12, fig.height = 5.75)
knitr::read_chunk("flex-rsds-1.R")
storyboard <- params$storyboard
rsds1 <- readRDS(url("https://s3.amazonaws.com/leonawicz/apps/snapflex/rsds1/rsds1.rds"))
simplify <- params$simplify
loc <- params$location
loc2 <- paste(loc, snaplocs::get_state(loc), sep = ", ")
d <- rsds1[[loc2]]

Row {data-height=500}

Solar irradiance time series by model

p1
a1 <- "Figure 1 shows a historical baseline in gray and projected trends for each climate model using the other colors.\n\n"
a2 <- paste0("The colored trend lines and scatter plot of projected model outputs are faded to highlight the mean trend over the projected period. ", pct_change_statement, "\n\n")
a3 <- paste("The regression equation for the", contrast, "trend line is shown. This helps discern any trend in solar irradiance with time, but keep in mind that a simple linear regression model of mean annual solar irradiance on time is not intended to explain much of the variation in solar irradiance across models, hence the low R-squared.\n\n")
a <- paste0("***\n\n", a1, a2, a3)

r if(exists("a")) knitr::knit(text = a)

Aggregate historical and projected period solar irradiance densities

p2
a1 <- "Figure 2 shows historical and projected distributions of annual solar irradiance over time.\n\n"
a2 <- "The historical distribution pertains to solar irradiance observations based on downscaled CRU 4.0 data. The spread in projected outputs comes from pooling the five climate models.\n\n"
a3 <- "Note that the latter distribution sample contains more observations than the former, using five models as well as a greater number of years.\n\n"
a <- paste0("***\n\n", a1, a2, a3)

r if(exists("a")) knitr::knit(text = a)

Row {data-height=500}

Solar irradiance box plots by model with select statistical tests

p3
a1 <- "Another view of solar irradiance distributions is shown in figure 3, one for each model.\n\n"
a2 <- paste0("P-values for select statisticial tests for differences in group means of each climate model with respect to CRU 4.0 as the reference group are shown on the plot.\n", 
             "The global Kruskal-Wallis p-value is also shown, though for these data sets its significance is not surprising.\n\n")
a3 <- "Climate model projected period distirbution means for solar irradiance may differ significantly from the CRU 4.0 baseline in either direction and variability is greater across a set of climate models, as was seen in figure 2.\n\n"
a <- paste0("***\n\n", a1, a2, a3)

r if(exists("a")) knitr::knit(text = a)

Projected mean solar irradiance by model for select 30-year windows

p4
a1 <- "Figure 4 shows mean period solar irradiance for each climate model during each of three future 30-year windows.\n\n"
a2 <- "Each period is broken out with a different color. Within periods, models are ranked by mean solar irradiance.\n\n"
a <- paste0("***\n\n", a1, a2)

r if(exists("a")) knitr::knit(text = a)

Row {data-height=50}

caption <- pct_change_statement

r if(exists("caption")) knitr::knit(text = caption)



leonawicz/snapflex documentation built on May 21, 2019, 9:21 a.m.