You may need to configure a proxy server if you're having trouble cloning
or fetching from a remote repository or getting an error
like unable to access '...' Couldn't resolve host '...'
.
Consider something like:
# somewhat hackish solution to: | |
# https://twitter.com/EamonCaddigan/status/646759751242620928 | |
# based mostly on copy/pasting from ggplot2 geom_violin source: | |
# https://github.com/hadley/ggplot2/blob/master/R/geom-violin.r | |
library(ggplot2) | |
library(dplyr) | |
"%||%" <- function(a, b) { |
library(tidyverse) | |
library(purrr) | |
library(rstan) | |
### Defining the data ### | |
######################### | |
bumblebees <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, | |
0, 0, 1, 0, 0, 0, 0, 0, 0) | |
toddler_steps <- c(26, 16, 37, 101, 12, 122, 90, 55, 56, 39, 55, 15, 45, 8) |
# Adapted from https://stackoverflow.com/a/7267364/1036500 by Andrie de Vries | |
# This is it: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) | |
library(ggplot2) | |
td <- expand.grid( | |
hjust=c(0, 0.5, 1), | |
vjust=c(0, 0.5, 1), | |
angle=c(0, 45, 90), |
library(tidyverse)
library(patchwork)
diff_nu <- ggplot(data = tibble(x = c(0, 200)), aes(x = x)) +
geom_area(stat = "function", fun = dexp, args = list(rate = 1/29),
fill = "darkblue", color = "black") +
labs(x = expression(Normality ~ parameter ~ (nu)), y = "Density") +
annotate(geom = "label", x = 100, y = 0.009, label = "Exponential(1/29)") +
theme_minimal() +
library(tidyverse)
library(broom)
library(lme4)
set.seed(1234)
# Make fake data
# 2x2x2 factorial design
df <- tibble(id = 1:1000,
library(dplyr, warn.conflicts = FALSE) | |
library(gapminder) | |
probs <- c(0.1, 0.5, 0.9) | |
gapminder %>% | |
group_by(continent) %>% | |
summarise( | |
probs = probs, | |
across(is.numeric & !year, ~ quantile(.x, probs)) | |
) |
library(dplyr) | |
library(slider) | |
library(lubridate) | |
library(tsibbledata) | |
# Google, Apple, Facebook, Amazon stock | |
gafa_stock <- as_tibble(gafa_stock) | |
gafa_stock <- select(gafa_stock, Symbol, Date, Close, Volume) | |
head(gafa_stock, 2) |