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
@AlbertRapp
AlbertRapp / street_map_game_mechanics.qmd
Created June 19, 2022 14:59
Testing out the mechanics for a shiny web app/game with maps and street names
---
output: html_document
editor_options:
chunk_output_type: console
---
## Load Packages
```{r}
setwd(here::here('streep_map_game/'))
#Create an explicit binomially distributed set of numbers
n = 1000
frac = 0.9
x = rep(c(1,0),times = c(n*frac, n*(1-frac)))
#Fit a Gaussian model and a binomial model to the same data
gauss_mod = glm(x~1,family = gaussian)
binom_mod = glm(x~1, family= binomial)
#Compare AIC
@jebyrnes
jebyrnes / coauthors_nsf_coa.R
Last active November 1, 2024 18:00
Get your coauthors for the last 4 years, nsf-style
library(scholar)
library(dplyr)
library(purrr)
library(tidyr)
id <- "hJKBuhkAAAAJ"
#me <- get_profile(id)
pubs <- get_publications(id) %>% as_tibble
@benmarwick
benmarwick / inspect-rmd-diff-from-last-commit.R
Last active February 8, 2024 21:17
GitHub doesn't show rich diffs for Rmd files. That can make collaborative writing tough. Here's how to see rich diffs of two commits of a single R Markdown document on a GitHub repo or local Git repo
# another method
# remotes::install_github("ropenscilabs/reviewer")
browseURL(reviewer::diff_rmd("analysis/paper/paper.qmd",
# this gets the sha of the previous commit
git2r::commits(n=2)[[2]]$sha)$raw)
@goldingn
goldingn / parallel_zoon.R
Created October 31, 2017 22:19
example of executing a zoon workflow in parallel (using experimental branch)
# install the experimental parallel branch
# remotes::install_github("zoonproject/zoon@parallel")
library (zoon)
# example workflow for 4 independent models that may take a while to run
run_wf <- function () {
workflow(occurrence = UKAnophelesPlumbeus,
covariate = UKBioclim,
process = Replicate(Background(n = 1000), 4),
model = GBM(max.trees = 10000),
@viciana
viciana / DatosClimaAndalucia.R
Created April 4, 2017 16:30
Ejemplo de descarga de datos climaticos
# require(devtools)
# install_github('SevillaR/Andaclima')
require(Andaclima)
rm(list = ls())
stations <- getAndalusia_ACS()
metainfo <- getMetaData(provincia = stations$province.code,
estacion = stations$station.code ,
@shyuep
shyuep / collaborators_list.py
Last active November 1, 2024 18:00
Generates a NSF collaborator list from a bibtex.
#!/usr/bin/env python
"""
Script for generating collaborators in a csv file from a bibtex, for easy
insertion into the new NSF format.
"""
from __future__ import division
import datetime
install.packages('zoon')
library(zoon)
vignette('Building_a_module')
#############
## Simples ##
#############
@jhollist
jhollist / beamer_two_col.Rmd
Created February 3, 2016 18:51
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)
@jesperronn
jesperronn / docx2md.md
Last active November 15, 2024 20:52 — forked from aembleton/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