This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
# Some fake points | |
N <- 500 | |
loc <- matrix(runif(2*N), ncol=2) | |
# A regular (not necessarily square) grid | |
n.row <- 10 | |
n.col <- 10 | |
xrange <- range(loc[,1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This procedure allows to plot blocks borders | |
# over some spatially-arranged variable | |
# Data is assumed to be on a regular grid | |
# The dataset contains row and column coordinates | |
# a numerical variable indicating the block number of the current cell | |
# and the numerical variable to be plotted | |
# Requirements: | |
# either package rgeos, which depends on [GEOS](http://trac.osgeo.org/geos/) (GEometry Open Source) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### ggplot MCMC posteriors and priors by scenario, parameter and replicas ### | |
### Author : Facundo Muñoz ([email protected]) | |
### Licence: GPL-3 | |
### Date : 2014-09-10 | |
### Required packages | |
library(rlist) # data-manipulation | |
library(plyr) | |
library(reshape2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Plotting the marginal prior distributions for the elements of | |
### an Inverse-Wishart matrix | |
library(MCMCpack) # Wishart distribution | |
library(actuar) # inverse gamma distribution | |
library(ggplot2) | |
## Hyperparameters of the inverse-Wishart prior | |
Phi <- matrix(c(1,.3,.3,2),2,2) # Scale matrix | |
nu <- 5 # Degrees of Freedom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Script de ejemplo para descargar datos de GREC (University of Valencia) | |
## Facundo Muñoz, 2015 | |
## Setup | |
# install.packages(rvest) | |
# install.packages('RSelenium') | |
library(rvest) | |
library('RSelenium') | |
checkForServer() | |
startServer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Create a minimal buildable package | |
library(devtools) | |
create('testpkg') | |
## Write src/install.libs.R | |
dir.create('testpkg/src') | |
test.file <- path.expand('~/testfile.txt') | |
diag.lines <- c( | |
deparse(quote(stop('This should break the installation'))), | |
deparse(quote(file.create(test.file))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$if(abstract)$ | |
%TC:envir abstract [] ignore | |
$endif$ | |
$if(arara)$ | |
$for(arara)$ | |
% arara: $arara$ | |
$endfor$ | |
$endif$ | |
\RequirePackage{fixltx2e} | |
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(papersize)$$papersize$$else$a4paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (c) 2018 Facundo Muñoz | |
# Latex Makefile using latexmk | |
# Modified by Dogukan Cagatay <[email protected]> | |
# Originally from : http://tex.stackexchange.com/a/40759 | |
# Modified for compilation of Markdown files with ideas from | |
# http://plain-text.co/pull-it-together.html | |
## What extension (e.g. md, markdown, mdown) is being used | |
## for markdown files MEXT = md | |
MEXT = md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TODAY=`date +%Y-%m-%d` | |
TODAY_MD=`date +%B\ %d,\ %Y` | |
YEAR=`date +%Y` | |
PROJECT=$1 | |
## | |
## CHANGE ME!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comparison estimations of multi-level models between lme4 and INLA | |
# inspired by question in the r-inla group: | |
# https://groups.google.com/forum/#!topic/r-inla-discussion-group/tmNdcYQ6KHk | |
pacman::p_load(INLA, lme4, tidyverse, broom, GGally) | |
sleepstudy %>% | |
ggplot(aes(Days, Reaction, color = Subject)) + | |
geom_point() |
OlderNewer