Skip to content

Instantly share code, notes, and snippets.

Francisco Rodriguez-Sanchez Pakillo

Block or report user

Report or block Pakillo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pakillo
Pakillo / repromap.R
Last active Mar 21, 2018
another reproducible map with Rstats
View repromap.R
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")
@Pakillo
Pakillo / projections.R
Last active Nov 17, 2017
Geographical projections I often use
View projections.R
## Often used spatial reference systems
## Source this gist from R:
# source("https://gist.githubusercontent.com/Pakillo/23212b72a02b9d524073/raw/b73b28354f61d381b5614a2254cf128b93e11c8a/projections.R")
# or using devtools:
# devtools::source_gist("https://gist.github.com/Pakillo/23212b72a02b9d524073")
## PROJECTIONS ##
crs.laea <- sp::CRS("+init=EPSG:3035") # Lambert Azimuthal Equal Area - ETRS89
@Pakillo
Pakillo / coauthor-networks.R
Created Feb 17, 2015
Coauthorsip networks
View coauthor-networks.R
# Author network mapping for journal publications.
# By: Simon Goring (final code: 10/2/2013)
# https://downwithtime.wordpress.com/2013/02/10/on-blogging-and-collaboration/
library(bibtex)
library(network)
library(RColorBrewer)
# Read in the bibtex file
# You can export this file from your google scholar network.
View iwanthue.R
swatch <- function(x) {
# x: a vector of colours (hex, numeric, or string)
par(mai=c(0.2, max(strwidth(x, "inch") + 0.4, na.rm = TRUE), 0.2, 0.4))
barplot(rep(1, length(x)), col=rev(x), space = 0.1, axes=FALSE,
names.arg=rev(x), cex.names=0.8, horiz=T, las=1)
}
# Example:
# swatch(colours()[1:10])
# swatch(iwanthue(5))
@Pakillo
Pakillo / Worldclim_Precipitation_Uncertainty.md
Last active May 16, 2017
Uncertainty in global climate databases: comparing Worldclim with Iberian climate atlas
View Worldclim_Precipitation_Uncertainty.md

Precipitation: Worldclim vs Iberian Climatic Atlas

Francisco Rodriguez-Sanchez 2017-05-16

library(knitr)
opts_chunk$set(cache = TRUE, message = FALSE)
library(raster)
View captions_and_crossrefs.rmd
---
title: "Auto-numbering and cross-referencing of figures and tables in rmarkdown"
output: html_document
---
TODO: check this out: https://github.com/adletaw/captioner
Here's how to use:
1. Copy and paste the first two code chunks in this document to the top of your document
@Pakillo
Pakillo / tryingRefManageR.md
Last active Apr 8, 2017
Quickly create and manage publication lists with RefManageR package
View tryingRefManageR.md
library(RefManageR)
BibOptions(check.entries=FALSE)

Read bibtex file with references:

refs <- ReadBib("C:\\Users\\FRS\\Desktop\\prueba.bib", check = "warn")
@Pakillo
Pakillo / simulate.gamm.R
Created Mar 3, 2017 — forked from gavinsimpson/simulate.gamm.R
S3 method for simulate() for "gamm" objects from package mgcv
View simulate.gamm.R
`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 / ShinyPerspectivePlot.R
Created Dec 19, 2016 — forked from leeper/ShinyPerspectivePlot.R
Shiny App for 3D Interaction plots
View ShinyPerspectivePlot.R
library("shiny")
library("shinyjs")
ui <- shinyUI(pageWithSidebar(
titlePanel("", "3D Perspective Plot for Interaction Effects"),
sidebarPanel(
tabsetPanel(
tabPanel("Data",
You can’t perform that action at this time.