Skip to content

Instantly share code, notes, and snippets.

View Pakillo's full-sized avatar
🌳
Living the dream

Francisco Rodriguez-Sanchez Pakillo

🌳
Living the dream
View GitHub Profile
@Pakillo
Pakillo / beamer_two_col.Rmd
Created November 7, 2016 17:42 — forked from jhollist/beamer_two_col.Rmd
This .Rmd shows how to use two (or more) columns in a Beamer Presentation from RStudio
---
title: "Untitled"
author: "Jeff W. Hollister"
date: "2/2/2016"
output: beamer_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
@Pakillo
Pakillo / ShinyPerspectivePlot.R
Created December 19, 2016 10:08 — forked from leeper/ShinyPerspectivePlot.R
Shiny App for 3D Interaction plots
library("shiny")
library("shinyjs")
ui <- shinyUI(pageWithSidebar(
titlePanel("", "3D Perspective Plot for Interaction Effects"),
sidebarPanel(
tabsetPanel(
tabPanel("Data",
@Pakillo
Pakillo / simulate.gamm.R
Created March 3, 2017 16:53 — forked from gavinsimpson/simulate.gamm.R
S3 method for simulate() for "gamm" objects from package mgcv
`simulate.gamm` <- function(object, nsim = 1, seed = NULL, newdata,
freq = FALSE, unconditional = FALSE, ...) {
if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE))
runif(1)
if (is.null(seed))
RNGstate <- get(".Random.seed", envir = .GlobalEnv)
else {
R.seed <- get(".Random.seed", envir = .GlobalEnv)
set.seed(seed)
RNGstate <- structure(seed, kind = as.list(RNGkind()))
@Pakillo
Pakillo / diverge0.R
Created December 12, 2019 13:44 — forked from johnbaums/diverge0.R
Plot a rasterVis::levelplot with a colour ramp diverging around zero
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())) {