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 / BANOVA.r
Last active August 29, 2015 14:13 — forked from benmarwick/BANOVA.r
# Joseph R. Mihaljevic
# July 2013
# (Partial) Bayesian analysis of variance, accounting for heteroscedasticity
# Generate some artificial data:
# Normally distributed groups, but heteroscedastic
a <- rnorm(25, mean=8, sd=10)
b <- rnorm(50, mean=5, sd=2)
c <- rnorm(25, mean=3, sd=.1)
d <- rnorm(25, mean=11, sd=3)
e <- rnorm(50, mean=13, sd=2)
# Here are a few methods for getting text from PDF files. Do read through
# the instructions carefully! NOte that this code is written for Windows 7,
# slight adjustments may be needed for other OSs
# Tell R what folder contains your 1000s of PDFs
dest <- "G:/somehere/with/many/PDFs"
# make a vector of PDF file names
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE)
## Function to use GDAL to project coordinate reference system
# See http://www.gdal.org/gdalwarp.html for additional details
# `resampling` can be 'near' (nearest neighbour), 'bilinear', 'cubic', or
# 'lanczos' (Lanczos windowed sinc resampling).
# `extent` should be a bbox object or a vector of c(xmin, ymin, xmax, ymax)
# `of` is the output format (use GDAL short name as given by the name field of
# gdalDrivers(), or at http://www.gdal.org/formats_list.html)
# `extension` is the output extension corresponding to the primary file
# `ot` is the output type (see http://www.gdal.org/gdal_translate.html)
@Pakillo
Pakillo / tables.Rmd
Created September 30, 2015 14:11 — forked from benmarwick/tables.Rmd
Methods for tables with rmarkdown
---
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 / docx2md.md
Created January 11, 2016 14:21 — forked from jesperronn/docx2md.md
Convert a Word Document into 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 / Rprogramming-syllabus.md
Last active September 13, 2016 15:32 — forked from hadley/curriculum.md
R programming syllabus by Hadley Wickham

Notes:

  • I've tried to break up in to separate pieces, but it's not always possible: e.g. knowledge of data structures and subsetting are tidy intertwined.

  • Level of Bloom's taxonomy listed in square brackets, e.g. http://bit.ly/15gqPEx. Few categories currently assess components higher in the taxonomy.

Programming R curriculum

Data structures

@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()))
---
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