This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(hrbrthemes) | |
library(ggrepel) | |
library(weatherBOM) | |
# Return day of the season | |
sday <- function(date, season = "summer") { | |
switch( | |
season, | |
summer = if_else(month(date) %in% c(12, 1, 2), yday(date %m+% months(1)), NA), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Untitled" | |
output: html_document | |
date: "2022-10-22" | |
--- | |
```{r, echo = FALSE} | |
htmltools::tagList( | |
htmltools::tags$script(src = "https://code.highcharts.com/highcharts.js"), | |
htmltools::tags$script(src = "https://code.highcharts.com/highcharts-more.js"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: Rosetta RIN Data Portal | |
# Years: 2007-2021 (FYEs) | |
# Extraction/update timestamp: 10/01/2022 | |
year,field,description,unit,value | |
2010,DOPED01,Total energy delivered,GWh,2873 | |
2011,DOPED01,Total energy delivered,GWh,2896 | |
2012,DOPED01,Total energy delivered,GWh,2910 | |
2013,DOPED01,Total energy delivered,GWh,2891 | |
2014,DOPED01,Total energy delivered,GWh,2904 | |
2015,DOPED01,Total energy delivered,GWh,2856.060 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Gist for https://discourse.mc-stan.org/t/dose-response-model-with-partial-pooling/13823 | |
## | |
## Version 28 March 2020 | |
## | |
## Changelog: | |
## - Priors on `c` and`d` are now lognormals (see @arya's comments) | |
## - Fixed priors on the hyperparameters for `d` (see @FJCC's comments) | |
# | |
# _Originally_ | |
## mu_d ~ normal(max(y), 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Untitled" | |
output: ioslides_presentation | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = FALSE) | |
``` | |
## Sample plotly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my.vennDiagram <- function (object, include = "both", names = NULL, mar = rep(1, | |
4), cex = c(1.5, 1, 0.7), lwd = 1, circle.col = NULL, counts.col = NULL, | |
show.include = NULL, ...) | |
{ | |
include <- as.character(include) | |
LenInc <- min(length(include), 2) | |
if (is(object, "VennCounts")) { | |
include <- include[1] | |
LenInc <- 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data from Stata manual, p.5: | |
# "We wish to analyze an experiment testing the ability of emergency | |
# generators with a new-style bearing to withstand overloads. For this | |
# experiment, the overload protection circuit was disabled, and | |
#the generators were run overloaded until they burned up. " | |
# https://www.stata.com/manuals13/ststcox.pdf | |
df <- read.table(text = | |
"failtime load bearings | |
100 15 0 | |
140 15 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROLOGUE | |
A long time ago, in a galaxy far, far away... | |
The Clone Wars were over, leaving entire civilizations in ruin. The Jedi Knights were all but extinct. And the Old Republic — the democratic galactic government that had prevailed for almost 25,000 years — had been replaced by the Galactic Empire. | |
Yet the Empire’s supreme ruler, the evil Emperor Palpatine, remained hungry for even more power. To expand his rule and crush all remnants of the Old Republic, Palpatine had approved the construction of a secret weapon: the Death Star, an immense armored space station that could destroy an entire planet. | |
The Empire was not without opposition. The Alliance to Restore the Republic — commonly known as the Rebel Alliance — led the fight to overturn the Empire and bring justice and freedom back to the galaxy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install packages for RMarkdown workshop | |
pkg <- c("ggplot2", "rmarkdown", "knitr", "dplyr", "hrbrthemes", "scatterD3", "pander", "xtable", "DT", "plotly"); | |
lapply(pkg, function(x) { if (!require(x, character.only = TRUE, quietly = TRUE)) { | |
cat(sprintf("Installing R package %s\n", x)); | |
install.packages(x, repos = "http://cran.rstudio.com/"); | |
require(x, character.only = TRUE, quietly = TRUE)} | |
}) |