fs | base | shell |
---|---|---|
dir_ls("/path") |
list.files("/path") |
ls /path |
dir_info("/path") |
do.call(rbind, lapply(list.files("/path"), file.info)) |
ls -al /path |
dir_copy("/path", "/new-path") |
dir.create("/new-path"); file.copy("/path", "/new-path", recursive=TRUE) |
cp /path /new-path |
dir_create("/path") |
dir.create("/path") |
mkdir /path |
dir_delete("/path") |
unlink("/path", recursive = TRUE) |
rm -rf /path |
dir_exists("/path") |
dir.exists("/path") |
if [ -d "/path" ]; then ... ; fi |
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
#: Color scheme {{{ | |
foreground #ebdbb2 | |
background #282828 | |
#: black | |
color0 #282828 | |
color8 #928374 | |
#: red |
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
################################################################## | |
## Function ## | |
################################################################## | |
fish <- function(l, keys, .dflt = NULL, missing.rm = FALSE) { | |
if(!is.list(keys)) stop("The keys to search should be given as a list.") | |
modified_names <- names(keys) %||% rep("", length(keys)) %>% | |
str_replace("^$", as.character(NA)) |
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(tidycensus) | |
library(mapdeck) | |
library(tidyverse) | |
token <- "your mapbox token" | |
hv <- get_acs(geography = "tract", | |
variables = "B25077_001", | |
state = "CA", | |
geometry = TRUE) %>% |
I am looking forward to meeting you at the Tuesday AM (10th of July) tutorial session at useR2018!. We will be discussing a subject that I am very passionate about: Web Scraping!
The slides can be found here:
To ensure that we can be immediately productive on Tuesday morning, I would like you to get the following set up on your machines beforehand:
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
europe <- c("France", "United Kingdom", "Belgium", "Italy", "Spain", | |
"Luxembourg", "Ireland", "Netherlands", "Portugal", "Andorra", | |
"Denmark", "Sweden", "Finland","Germany", "Poland", "Greece", | |
"Macedonia", "Bosnia-Herzegovina", "Serbia", "Croatia", "Bulgaria", | |
"Romania", "Hungary", "Czech Republic", "Lithuania", "Estonia", | |
"Austria", "Slovakia", "Slovenia", "Albania", "Latvia", "Moldova", | |
"Switzerland", "Belarus") | |
readr::read_csv("~/Desktop/week13_alcohol_global.csv") %>% | |
dplyr::select(-total_litres_of_pure_alcohol, -spirit_servings) %>% |
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 Country 3 letters ISO code and correct the ones not mapping to FIFA data | |
iso_url <- "https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3" | |
iso_html <- xml2::read_html(iso_url) | |
iso_country <- iso_html %>% | |
rvest::html_table(fill=TRUE) %>% | |
.[2:4] %>% | |
dplyr::bind_rows() %>% | |
purrr::set_names(c("code","country")) %>% | |
dplyr::mutate(country=if_else(country=="Côte d'Ivoire", | |
"Ivory Coast", country), |
Tired of waiting for emacs to start on OS X? This step by step guide will
teach you how to install the latest version of emacs and configure it to start
in the background (daemon mode) and use emacsclient
as your main editor.
Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds
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
usbWatcher = nil | |
function usbDeviceCallback(data) | |
if (data["productName"] == "Kinesis Keyboard Hub") then | |
if (data["eventType"] == "added") then | |
hs.keycodes.setLayout("U.S. International - PC") | |
elseif (data["eventType"] == "removed") then | |
hs.keycodes.setLayout("Swiss French") | |
end | |
end |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugin | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |