This file contains hidden or 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
#' --- | |
#' output: github_document | |
#' --- | |
#' Worth reminding that `summarise_*()` needs n-to-1 function, `mutate_*()` | |
#' needs n-to-n function? | |
#' | |
#' I can use variable selection helpers from `select()`. Yay! I just didn't | |
#' expect I would need to put them inside of `vars()`. | |
#' |
This file contains hidden or 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
> session_info("xml2")$packages | |
package * version date source | |
BH 1.60.0-2 2016-05-07 CRAN (R 3.2.5) | |
Rcpp 0.12.5 2016-05-14 cran (@0.12.5) | |
xml2 0.1.2.9000 2016-05-26 Github (jimhester/xml2@88150bc) | |
> library(xml2) | |
> x <- read_xml(' | |
+ <catalog xmlns="http://www.edankert.com/examples/"> | |
+ <cd> | |
+ <artist>Sufjan Stevens</artist> |
This file contains hidden or 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
#' --- | |
#' output: github_document | |
#' --- | |
#+ setup, include = FALSE | |
knitr::opts_chunk$set( | |
collapse = TRUE, | |
comment = "#>", | |
error = TRUE | |
) |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"> | |
<numFmts count="1"> | |
<numFmt numFmtId="164" formatCode=""$"#,##0.00"/> | |
</numFmts> | |
<fonts count="4"> | |
<font> | |
<sz val="10.0"/> | |
<color rgb="FF000000"/> | |
<name val="Arial"/> |
This file contains hidden or 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
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gs="http://schemas.google.com/spreadsheets/2006"> | |
<id>SOME_URL</id> | |
<entry> | |
<batch:id>A1</batch:id> | |
<batch:operation type="update"/> | |
<id>https://spreadsheets.google.com/feeds/cells/1tP1SAErOJbMrTTCONdL0a9lwe3KkhTuZaGhCy3MPZP8/ozf3txt/private/full/R1C1</id> | |
<link rel="edit" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/cells/1tP1SAErOJbMrTTCONdL0a9lwe3KkhTuZaGhCy3MPZP8/ozf3txt/private/full/R1C1/fu9n6e"/> | |
<gs:cell row="1" col="1" inputValue="country"/> | |
</entry> | |
<entry> |
This file contains hidden or 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
## http://polygraph.cool/films/ | |
## https://github.com/matthewfdaniels/scripts | |
x <- "https://raw.githubusercontent.com/matthewfdaniels/scripts/master/data/character_list5.csv" | |
characters <- read.csv(x, na.strings = c("NULL", "?"), | |
fileEncoding = "ISO-8859-1", stringsAsFactors = FALSE) | |
## some ages are clearly (negative) birth years ... oops | |
characters$age[!is.na(characters$age) & characters$age < 0] <- NA | |
characters$age[!is.na(characters$age) & characters$age > 105] <- NA |
This file contains hidden or 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
^(?:(?:([^/]+)/)?([^/@#]+)(?:/([^@#]*[^@#/]))?(?:(?:@([^*].*))|(?:#([0-9]+))|(?:@([*]release)))?|(.*))$ |
This file contains hidden or 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: "A Perfect Storm" | |
output: html_document | |
--- | |
```{r} | |
options(knitr.table.format = 'markdown') | |
``` | |
This file contains hidden or 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(googlesheets) | |
cdp <- "http://i.imgur.com/lrg4uy5.jpg" | |
cell_contents <- paste0("=IMAGE(\"", cdp, "\", 2)") | |
ss <- gs_new("cute-dog-photo-in-cell-2", input = cell_contents) | |
gs_browse(ss) ## you'll have to change the row size in the browser | |
## ss$browser_url |
This file contains hidden or 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
#' --- | |
#' output: | |
#' html_document: | |
#' keep_md: TRUE | |
#' --- | |
# install_github("gaborcsardi/gh") | |
library(gh) | |
suppressPackageStartupMessages(library(dplyr)) | |
suppressPackageStartupMessages(library(purrr)) |