Skip to content

Instantly share code, notes, and snippets.

🌳
Living the Bayesian dream

Francisco Rodriguez-Sanchez Pakillo

🌳
Living the Bayesian dream
View GitHub Profile
@Pakillo
Pakillo / beamer_two_col.Rmd
Created Nov 7, 2016 — forked from jhollist/beamer_two_col.Rmd
This .Rmd shows how to use two (or more) columns in a Beamer Presentation from RStudio
View beamer_two_col.Rmd
---
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 / gist:d2ee89f78a5a85dc4b1593e7bf82afe9
Last active Nov 4, 2016
ploting prior and posterior Bayes
View gist:d2ee89f78a5a85dc4b1593e7bf82afe9
- https://mvuorre.github.io/r/ggplot2-visualizing-prior-posterior/
- https://users.soe.ucsc.edu/~draper/beta-distributions-r.txt
- http://shinyapps.org/apps/RGraphCompendium/index.php#prior-and-posterior
- https://alexanderetz.com/2015/07/25/understanding-bayes-updating-priors-via-the-likelihood/
- http://doingbayesiandataanalysis.blogspot.com.es/2015/10/posterior-predicted-distribution-for.html
- http://www.stat.cmu.edu/~hseltman/rube/rubeManual.pdf
- http://stackoverflow.com/questions/19476744/how-to-plot-bayesian-prior-and-posterior-distributions-in-one-panel-using-r
@Pakillo
Pakillo / themes.R
Last active Sep 6, 2018
ggplot_themes
View themes.R
### 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(),
@Pakillo
Pakillo / RFetchClimate.md
Created Apr 22, 2016
Fetch climate data in R with package RFc
View RFetchClimate.md

New R package to fetch climate data from FetchClimate webservice

Francisco Rodriguez-Sanchez
22 April 2016

Trying new RFc package to get climate data into R from FetchClimate service.

See all the available climate variables here.

@Pakillo
Pakillo / rootdir.R
Created Mar 11, 2016
Get root directory of a Rstudio project
View rootdir.R
library(rprojroot)
root <- find_rstudio_root_file()
@Pakillo
Pakillo / Rpres_fontsize.Rpres
Created Mar 11, 2016
Controlling font size in Rpres
View Rpres_fontsize.Rpres
Example slide
==============
<font size = "5px">
```{r echo = FALSE}
cleandata <- read.csv(file.path(root, "inst/extdata/coordsdata.csv"))
studies <- count(cleandata, ref, species, variable)
kable(studies)
```
@Pakillo
Pakillo / docx2md.md
Created Jan 11, 2016 — forked from jesperronn/docx2md.md
Convert a Word Document into MD
View docx2md.md

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@Pakillo
Pakillo / tables.Rmd
Created Sep 30, 2015 — forked from benmarwick/tables.Rmd
Methods for tables with rmarkdown
View tables.Rmd
---
title: "A few methods for making tables in rmarkdown"
output: html_document
---
Updates:
Packages that have appeared since my original look into this, and seem great:
https://github.com/yihui/printr
@Pakillo
Pakillo / calculate-cover.R
Created Jul 8, 2015
Calculate plant and bare ground cover in vegetation transects
View calculate-cover.R
#' Calculate total cover per species in vegetation transects
#'
#' Calculate total cover per species in each transect, layer within transect, etc.
#' Optionally, the function can also calculate length of bare ground (as ground not covered
#' by any plant species).
#'
#' @export
#' @author F Rodriguez-Sanchez
#' @importFrom plyr ddply
#' @importFrom gtools odd even
You can’t perform that action at this time.