Skip to content

Instantly share code, notes, and snippets.

@jananiravi
jananiravi / find_local_tweeps.R
Last active February 19, 2019 23:16 — forked from stephlocke/find_local_tweeps.R
A visit to Michigan | Finding 'persons of interest' | Twitter
# Orig tweeps author: stephlocke
# Adapted to find data scientists in the Michigan, East Lansing area!
library(rtweet) #rtweet API creds should already be set up
library(stringi)
library(tidyverse)
friends = get_friends(user="gdequeiroz ") #stephlocke #JennyBryan #hadleywickham
followers = get_followers("gdequeiroz") #janani137
tweeps_id = distinct(bind_rows(friends, followers))
@jananiravi
jananiravi / backstitch.R
Created August 14, 2019 16:41 — forked from gadenbuie/backstitch.R
Convert Rmd document (knitr::knit) to an R script (knitr::spin) #RMarkdown #knitr #knit #spin
warning("You probably don't want to use this `backstitch()` function.",
"\n It's hacky and there's a much better option in knitr called `purl()`.",
"\n More info at: `?knitr::purl`")
#' Backstitch an Rmd file to an R script
#'
#' Takes an Rmd file -- that would be converted with knitr::knit() -- and
#' "backstitches" it into an R script suitable for knitr::purl(). The output
#' file is the just the backstitched R script when `output_type = 'script'`, or
#' just the code chunks when `output_type = 'code'` (note that all inline code