This file contains 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
# Get a person's name, location, summary, # of connections, and skills & endorsements from LinkedIn | |
# URL of the LinkedIn page | |
user_url <- "https://www.linkedin.com/in/daattali" | |
# since the information isn't available without being logged in, the web | |
# scraper needs to log in. Provide your LinkedIn user/pw here (this isn't stored | |
# anywhere as you can see, it's just used to log in during the scrape session) | |
username <- "yourusername" | |
password <- "yourpassword" |
This file contains 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) | |
source('geom_font_awesome.R') | |
shapes_map = c( | |
setosa = 'car', | |
virginica = 'ban', | |
versicolor = 'star' | |
) | |
( |
This file contains 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
# Gelman and Hill 2007: Chapter 3 Regression Examples | |
# Using ggplot and estimatr | |
rm(list = ls()) | |
# Uncomment to install | |
# install.packages("ggplot2") | |
# install.packges("haven") | |
# install.pacakges("estimatr") | |
library(ggplot2) |
This file contains 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
title: "[Title Goes Here]" | |
author: "[Blinded for Review]" | |
documentclass: "article" | |
output: | |
pdf_document: | |
keep_tex: true | |
number_sections: true | |
highlight: "tango" | |
toc: true | |
md_extensions: +implicit_figures +grid_tables +fenced_code_blocks +fenced_code_attributes |
This file contains 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
# Early in the script | |
pkgs_pre_script <- try(devtools::loaded_packages(), silent = TRUE) | |
# Late in the script | |
pkgs_used_during_script <- try(devtools::loaded_packages(), silent = TRUE) | |
cat("* ") | |
print(citation(), style="text") # or Bibtex or LaTeX |
This file contains 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
# Sample data | |
X <- data.frame( | |
x = c(1, 2, 3), | |
y = c(4, 5, 6), | |
etc = c("a", "b", "c") | |
) | |
# Arbitrary stand-in for function that can't be vectorized (no pmax) | |
max.fun <- function(a, b) { max(c(a, b)) } |
NewerOlder