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(gganimate) | |
library(tidyphreeqc) | |
phr_use_db_minteq() | |
theme_set(theme_bw()) | |
library(ggspatial) | |
result <- phr_run( | |
phr_solution_list( | |
pH = seq(3, 13, 0.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
--- | |
title: "Paleogeography of earth for the past 542 million years" | |
author: "Dewey Dunnington" | |
date: '2018-08-20' | |
output: github_document | |
--- | |
```{r setup, include=FALSE} | |
library(rvest) | |
library(tidyverse) |
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(tibble) | |
library(dplyr) | |
library(purrr) | |
chisq_test_distr <- function(sample, fit_p, nbins = floor(length(sample) / 8)) { | |
cut_quantiles <- seq(0, 1, length.out = nbins + 1) | |
cut_values <- quantile(sample, cut_quantiles) | |
cut_values[1] <- -Inf | |
cuts <- tibble( |
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(tidyphreeqc) | |
phr_input( | |
phr_surface_master_species("Iron_oxy", "Iron_oxyOH"), | |
phr_surface_species("Iron_oxyOH = Iron_oxyOH"), | |
phr_surface_species("Iron_oxyOH + Zn+2 = Iron_oxyOZn+ + H+", log_k = -1.99), | |
phr_solution("Zn" = 0.1, units = "mol/kgw"), | |
phr_surface( | |
Iron_oxyOH = phr_surface_item(sites = 0.07, specific_area_per_gram = 600, grams = 30) |
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(tidyphreeqc) | |
solution_cacl2 <- phr_solution( | |
0, "CaCl2", | |
units = "mmol/kgw", | |
temp = 25, | |
pH = "7 charge", | |
pe = "12.5 O2(g) -0.68", | |
Ca = 0.6, |
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: "R Notebook" | |
output: html_notebook | |
--- | |
```{r setup} | |
library(tidyverse) | |
``` | |
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(ggplot2) | |
# these are defined elsewhere | |
x <- runif(100) | |
border <- "black" | |
xlabel <- "xlabel" | |
col <- "white" | |
compQ <- function(x, quant) quantile(x, quant) | |
# this is where your code |
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(testthat) | |
library(rlang) | |
withr::with_namespace("ggplot2", { | |
# Checks that mapping refers to at least one column in data | |
check_aes_column_refs <- function(mapping, data) { | |
if (empty(data) || length(mapping) == 0) return() | |
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(ggplot2) | |
ScaleDataFrame <- ggproto( | |
"ScaleDataFrame", Scale, | |
aesthetics = NULL, | |
plot_env = emptyenv(), | |
scales_list = ggproto(NULL, ggplot2:::ScalesList), | |
transform = function(self, x) { | |
x[] <- purrr::map2( |
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(sf) | |
box <- st_bbox(c(xmin = -120, xmax = -60, ymin = 45, ymax = 80), crs = 4326) | |
poly <- tibble(geometry = st_as_sfc(box)) %>% st_as_sf() | |
boundary <- st_cast(poly, "LINESTRING") | |
boundary_points <- st_make_grid(boundary, what = "corners") %>% | |
tibble(geometry = .) %>% | |
st_as_sf() %>% |
OlderNewer