Skip to content

Instantly share code, notes, and snippets.

View perthr's full-sized avatar

Greg White perthr

  • Curtin University
  • Perth, Western Australia
View GitHub Profile

Simple data manipulations in R

Many years ago, I was introduced to R by Cam Webb . At the time, his website contained a list of common data manipulations (original here). This list dated from Cam's early experience with R, and contained the R-help mailing list responses to a series of data manipulations. For a long time, I kept this file as a handy reference. I printed it out. I recommended it to friends.

Now I have been using R for years, and the state of the art has advanced considerably. Particulary, Hadley Wickham's reshape2 and dplyr packages have transformed the way most useRs manipulate their data. I decided that it would be interesting to revisit my favourite resource and try my hand at solving these problems with tools from these two packages.

library(reshape2)
library(dplyr)
@perthr
perthr / Readme.md
Created March 30, 2020 06:10 — forked from timelyportfolio/Readme.md
3d yield curve with Plotly in R

Nowhere near as spectacular as the Upshot/New York Times 3d yield curve by Amanda Cox and Gregor Aisch, but not bad at all for a couple of lines of R code with the plotly htmlwidget.

library(plotly)
library(dplyr)
library(tidyr)
library(purrr)
library(quantmod)
library(magrittr)
@perthr
perthr / Readme.md
Created March 30, 2020 06:14 — forked from timelyportfolio/Readme.md
some examples with rbokeh inspired by ggplot2 and lattice

lattice

examples inspired by this book

ggplot2

examples inspired by this book

@perthr
perthr / SpotifyWebScraper.Rmd
Created March 30, 2020 07:31 — forked from imjakedaniels/SpotifyWebScraper.Rmd
Building a Web scraper, rvest, purr, dplyr, and ggplot2
```{r}
#packages
library(rvest)
library(tidyverse)
library(magrittr)
library(scales)
library(knitr)
library(lubridate)
```