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 / fig_label.R
Created April 10, 2017 17:03
R function to draw figure labels in base plots
## 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")) {
@Pakillo
Pakillo / git-github-tutorials.md
Last active July 8, 2023 13:51
Git & GitHub tutorials
@Pakillo
Pakillo / Rmarkdown-fontsize.Rmd
Created January 22, 2015 22:32
Changing font sizes of HTML ouput in Rmarkdown
---
title: "Untitled"
author: "Francisco Rodriguez-Sanchez"
date: "Thursday, January 22, 2015"
output: html_document
---
<style type="text/css">
body, td {
library(usethis)
create_package("templateRpackage")
## Use git & create repo on GitHub
use_git()
use_github(organisation = "EcologyR")
## Create README
@Pakillo
Pakillo / ggplot_resources.md
Last active October 17, 2022 04:38
ggplot2: tutorials and complementary packages
@Pakillo
Pakillo / relief_maps_rspatial.R
Last active July 22, 2022 15:59
Quick elevation maps with R
library(sf)
library(terra)
## Define area
coords <- data.frame(x = c(-5.5, -5.5, -5.3, -5.3),
y = c(36.7, 36.8, 36.7, 36.8))
coords.sf <- st_as_sf(coords, coords = c("x", "y"), crs = 4326)
## Download elevation data
@Pakillo
Pakillo / install.R
Last active May 16, 2022 14:14
Festival AEET - Taller Ciencia Reproducible - PREPARATIVOS
# Install R latest version: https://cloud.r-project.org/
# Install RStudio latest version: https://www.rstudio.com/products/rstudio/download/#download
# Install R packages below:
install.packages("remotes")
install.packages("rmarkdown")
install.packages("rticles")
# remotes::install_github("Pakillo/rmdTemplates") # optional
@Pakillo
Pakillo / projections.R
Last active November 24, 2021 10:58
Geographical projections I often use
## Spatial reference systems I often use
## 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")
# EPSG codes:
geo <- 4326 # Geographic, datum WGS84
laea.etrs89 <- 3035 # Lambert Azimuthal Equal Area - ETRS89