- assertr (https://github.com/tonyfischetti/assertr)
- validate (https://github.com/data-cleaning/validate)
- assertive (http://www.r-pkg.org/pkg/assertive)
- datacheckr (https://github.com/poissonconsulting/datacheckr)
- ensurer (https://github.com/smbache/ensurer)
- assertthat (https://github.com/hadley/assertthat)
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
diverge0 <- function(p, ramp) { | |
# p: a trellis object resulting from rasterVis::levelplot | |
# ramp: the name of an RColorBrewer palette (as character), a character | |
# vector of colour names to interpolate, or a colorRampPalette. | |
require(RColorBrewer) | |
require(rasterVis) | |
if(length(ramp)==1 && is.character(ramp) && ramp %in% | |
row.names(brewer.pal.info)) { | |
ramp <- suppressWarnings(colorRampPalette(brewer.pal(11, ramp))) | |
} else if(length(ramp) > 1 && is.character(ramp) && all(ramp %in% colors())) { |
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
## Working with Sentinel-2 bands in R | |
# Crear proyecto de RStudio | |
## Cargar paquetes necesarios | |
library(raster) |
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
## Working with Sentinel-2 bands in R | |
## Primeros pasos | |
# - Crear proyecto de RStudio | |
# | |
# - Guardar capas (ZIP) en la misma carpeta | |
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: Back to basics: High quality plots using base R graphics | |
### An interactive tutorial for the Davis R Users Group meeting on April 24, 2015 | |
### | |
### Date created: 20150418 | |
### Last updated: 20150423 | |
### | |
### Author: Michael Koontz | |
### Email: mikoontz@gmail.com | |
### Twitter: @michaeljkoontz | |
### |
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 favourite ggplot2 themes, always accessible ### | |
## just source this gist from any project ## | |
##################################################################################### | |
# Noam's default ggplot2 styling ##### | |
# Source: https://github.com/noamross/noamtools/blob/master/R/theme_nr.R | |
theme_nr <-theme(text=element_text(family="Helvetica", size=14), | |
panel.grid.major.x=element_blank(), |
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) | |
library(cowplot) | |
library(latex2exp) | |
#### PALEOTEMPERATURES #### | |
## Data from Hansen: http://www.columbia.edu/~jeh1/mailings/2012/20120508_ClimateSensitivity.pdf | |
## Available here: http://www.columbia.edu/~mhs119/Sensitivity+SL+CO2/Table.txt |
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(sf) | |
library(ggspatial) | |
library(ggthemes) | |
coast <- rnaturalearth::ne_coastline(scale = "small", returnclass = "sp") | |
forests <- st_read("data/forestmap/cfc_gen.shp") | |
forest.redux <- rmapshaper::ms_simplify(forests) | |
forest.redux.sp <- as(forest.redux, "Spatial") |