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
@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)
```
@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 / 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)

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 / r-interview.md
Created March 30, 2020 05:49 — forked from peterhurford/r-interview.md
R Interview Questions

1.) If I have a data.frame df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6), c(7, 8, 9))...

1a.) How do I select the c(4, 5, 6)?

1b.) How do I select the 1?

1c.) How do I select the 5?

1d.) What is df[, 3]?

---
title: "Beginner R Workshop"
output: html_document
date: October 27, 2016
author: Keegan Korthauer and Joseph N. Paulson
---
Today's workshop will be a gentle introduction to the
[R programming language](https://cran.r-project.org/). We have provided RStudio Server instances that you can access on the web, but we'll also briefly overview how you can install R and RStudio on your own computer. We'll start with some basics about programming and then get some hands-on experience with analyzing a real-world messy dataset that we'll collect from everyone live. We hope that you'll get a feel for what R can do as well as learn where you can learn more to use it on your own (great resources are listed at the end).
---
title: "Untitled"
author: "Ben Marwick"
date: "Wednesday, September 24, 2014"
output: html_document
---
## Introduction
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. You should read through this entire document very carefully before making any changes or pressing any buttons.
@perthr
perthr / dplyr_tutorial.Rmd
Created March 30, 2020 04:05 — forked from dgrapov/dplyr_tutorial.Rmd
hands on with dplyr
---
title: "Hands-on with dplyr"
author: "Dmitry Grapov"
output:
html_document:
keep_md: yes
---
## Introduction