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 / coauthor-networks.R
Created February 17, 2015 00:22
Coauthorsip networks
# Author network mapping for journal publications.
# By: Simon Goring (final code: 10/2/2013)
# https://downwithtime.wordpress.com/2013/02/10/on-blogging-and-collaboration/
library(bibtex)
library(network)
library(RColorBrewer)
# Read in the bibtex file
# You can export this file from your google scholar network.
@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 {
@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 / 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)
---
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
@Pakillo
Pakillo / word-character-count-Rstudio.md
Last active June 25, 2020 21:24
Count words and characters in Rstudio

As far as I know Rstudio does not count words or characters at the moment, which would be useful particularly when writing Rmarkdown.

This is a quick shortcut using word_count and character_count functions from qdap package. See below for two wrapper functions that simplify their use.

library("qdap")

Just select and copy the text to the clipboard and then run in the console:

@Pakillo
Pakillo / git-github-tutorials.md
Last active July 8, 2023 13:51
Git & GitHub tutorials
@Pakillo
Pakillo / tryingRefManageR.md
Last active April 8, 2017 22:01
Quickly create and manage publication lists with RefManageR package
library(RefManageR)
BibOptions(check.entries=FALSE)

Read bibtex file with references:

refs <- ReadBib("C:\\Users\\FRS\\Desktop\\prueba.bib", check = "warn")
@Pakillo
Pakillo / ncites_scholar
Last active August 29, 2015 13:57
Retrieve number of citations of a paper in Google Scholar
#' Retrieve number of citations of a paper in Google Scholar
#'
#' This function retrieves the number of citations of a given paper in Google Scholar.
#'
#' @param user character vector. The user ID in Google Scholar Citations. Obtain from author's profile website in google scholar (http://scholar.google.com/citations?user=...)
#' @param paper character vector. The paper ID in Google Scholar Citations. Copy from publication list in author's profile website.
#' @author F. Rodriguez-Sanchez
#' @examples
#' ncites_scholar(user="B7vSqZsAAAAJ", paper="d1gkVwhDpl0C")
#'