Francisco Rodriguez-Sanchez 2017-05-16
library(knitr)
opts_chunk$set(cache = TRUE, message = FALSE)
library(raster)| library(ggplot2) | |
| t <- 1:100 # create time sequence | |
| # warming trend, constant variance | |
| clima <- data.frame(t = t, | |
| temp = rnorm(100, 15 + 0.03*t, sd = 1)) | |
| # warming trend + increasing variance | |
| clima <- data.frame(t = t, |
| --- | |
| title: "Having separate reference lists in an Rmarkdown document" | |
| author: "F. Rodriguez-Sanchez" | |
| output: | |
| github_document: | |
| pandoc_args: --lua-filter=multiple-bibliographies.lua | |
| bibliography_main: main.bib | |
| bibliography_suppl: suppl.bib | |
| --- |
| https://stackoverflow.com/a/58679929 | |
| See also | |
| http://latex-beamer-class.10966.n7.nabble.com/Hiding-frames-td907.html | |
| https://tex.stackexchange.com/questions/200151/remove-frame-from-presentation | |
| https://tex.stackexchange.com/questions/200151/remove-frame-from-presentation |
| 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())) { |
| ## Working with Sentinel-2 bands in R | |
| # Crear proyecto de RStudio | |
| ## Cargar paquetes necesarios | |
| library(raster) |
| ## Working with Sentinel-2 bands in R | |
| ## Primeros pasos | |
| # - Crear proyecto de RStudio | |
| # | |
| # - Guardar capas (ZIP) en la misma carpeta | |
| 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 |
| 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") |
| ## from: https://logfc.wordpress.com/2017/03/15/adding-figure-labels-a-b-c-in-the-top-left-corner-of-the-plotting-region/ | |
| fig_label <- function(text, region="figure", pos="topleft", cex=NULL, ...) { | |
| region <- match.arg(region, c("figure", "plot", "device")) | |
| pos <- match.arg(pos, c("topleft", "top", "topright", | |
| "left", "center", "right", | |
| "bottomleft", "bottom", "bottomright")) | |
| if(region %in% c("figure", "device")) { |