Skip to content

Instantly share code, notes, and snippets.

@renkun-ken
renkun-ken / README.md
Last active August 29, 2015 14:06
A Pipe version with recommended practice

A Pipe version of Zev Ross.

An alternative version of timelyportfolio's and smbache's.

If you are not familiar with pipeR, you can read the still-in-progress pipeR tutorial. The best practices of pipeR's Pipe():

  • Keep side effects as small as possible, use it only when necessary.
  • Separate Pipes into concentrated pieces.
  • Don't avoid necessary intermediate variables.
@renkun-ken
renkun-ken / r-supportive-members
Last active August 29, 2015 14:06
Where do R's supportive members mainly come from?
library(pipeR) # https://github.com/renkun-ken/pipeR
library(rlist) # https://github.com/renkun-ken/rlist
library(rvest) # https://github.com/hadley/rvest
library(stringr) # https://github.com/hadley/stringr
# please ensure rvest is the latest dev version
Pipe("http://www.r-project.org/foundation/memberlist.html")$
html()$ # use xpath to scrape the name list
html_nodes(xpath = "//table[2]//td//text() | //table[3]//td//text()")$
html_text(trim = TRUE)$