examples inspired by this book
examples inspired by this book
```{r} | |
#packages | |
library(rvest) | |
library(tidyverse) | |
library(magrittr) | |
library(scales) | |
library(knitr) | |
library(lubridate) | |
``` |
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)
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)
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. |
--- | |
title: "Hands-on with dplyr" | |
author: "Dmitry Grapov" | |
output: | |
html_document: | |
keep_md: yes | |
--- | |
## Introduction |