Skip to content

Instantly share code, notes, and snippets.

View Ignimbrit's full-sized avatar

Sören Wilke Ignimbrit

View GitHub Profile
library(tidyverse) # wrangling tabular data and plotting
library(sf) # processing spatial vector data
library(sp) # another vector data package necessary for continuity
library(raster) # processing spatial raster data. !!!overwrites dplyr::select!!!
# Load Interpolation Libraries
library(gstat) # inverse distance weighted, Kriging
da1 <- read.csv("INT_4_ALOS_ASWAN_ZONE_1.csv")
names(da1)[4] <- "dh"
@Ignimbrit
Ignimbrit / simulated_geology_3dgif.R
Created November 26, 2020 21:46
Simulate some geological layers, plot them in a rgl 3D scene and save as .gif
library(tidyverse)
library(raster)
library(magick)
library(NLMR)
library(rgl)
# Let's start by simulating a digital elevation model
sim_DEM <- NLMR::nlm_fbm(
ncol = 100, nrow = 100, resolution = 10,
fract_dim = 1.6,
@Ignimbrit
Ignimbrit / pdf_decompose.R
Created November 14, 2019 19:17
Extract PDF pages as PNG images
pdf_decompose <- function(input_file, output_folder, pages = NA){
pdf_length <- as.integer(pdftools::pdf_info(input_file)$pages)
if(is.na(pages[1])){pages <- seq(1, pdf_length, 1)}
if(!all(purrr::map_lgl(pages, is.numeric))){
stop("pages must be a numeric vector")
}
@Ignimbrit
Ignimbrit / calcite solubility.R
Created September 3, 2019 19:12
Simulate Calcite Solubility with tidyphreeqc
library(tidyverse)
library(tidyphreeqc)
library(ragg)
T_range <- c(5, 10, 15, 20)
CO2_range <- seq(300, 1000, 5)
variables <- expand.grid(T_range, CO2_range)
names(variables) <- c("T [°C]", "CO2 [ppm]")