Skip to content

Instantly share code, notes, and snippets.

View withetu's full-sized avatar
🎯
Focusing

Sandip Paul withetu

🎯
Focusing
View GitHub Profile
@z3tt
z3tt / cedrics_theme.R
Created May 22, 2019 18:02
My ggplot theme
##----------------------------------------------------------------------------------------------------------##
## Cedric Scherer (cedricphilippscherer@gmail.com) ##
## Function for a custom ggplot theme ##
## 2017-05-27 ##
##----------------------------------------------------------------------------------------------------------##
library(ggplot2)
if ("extrafont" %in% rownames(installed.packages()))
{
@benmarwick
benmarwick / PDF-2-text-or-CSV.r
Last active July 18, 2022 03:48
Convert PDFs to text files or CSV files (DfR format) with R
# 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)
@stevenworthington
stevenworthington / ipak.R
Created July 25, 2012 19:44
Install and load multiple R packages at once
# ipak function: install and load multiple R packages.
# check to see if packages are installed. Install them if they are not, then load them into the R session.
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}