Make sure first element is heading
This commit is contained in:
parent
323477d7e5
commit
bad4c9d975
|
@ -4,9 +4,9 @@ title: Data structures
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
Might be quite brief.
|
||||
# Data structures
|
||||
|
||||
## Data structures
|
||||
Might be quite brief.
|
||||
|
||||
Atomic vectors and lists. What is a data frame?
|
||||
|
||||
|
|
|
@ -3,3 +3,5 @@ layout: default
|
|||
title: Dates and times
|
||||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Dates and times
|
||||
|
|
4
eda.Rmd
4
eda.Rmd
|
@ -4,6 +4,8 @@ title: Exploratory data analysis
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Exploratory data analysis
|
||||
|
||||
```{r, include = FALSE}
|
||||
library(ggplot2)
|
||||
knitr::opts_chunk$set(
|
||||
|
@ -12,8 +14,6 @@ knitr::opts_chunk$set(
|
|||
)
|
||||
```
|
||||
|
||||
## Exploratory Data Visualization
|
||||
|
||||
***
|
||||
|
||||
*Tip*: Throughout this section, we will rely on a distinction between two types of variables:
|
||||
|
|
|
@ -4,6 +4,8 @@ title: Expressing yourself
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Expressing yourself in code
|
||||
|
||||
```{r, include = FALSE}
|
||||
knitr::opts_chunk$set(
|
||||
cache = TRUE,
|
||||
|
@ -11,8 +13,6 @@ knitr::opts_chunk$set(
|
|||
)
|
||||
```
|
||||
|
||||
# Expressing yourself in code
|
||||
|
||||
Code is a means of communication, not just to the computer, but to other people. This is important because every project you undertake is fundamentally collaborative, and even if you're not working with other people you'll definitely be working with future-you.
|
||||
|
||||
After solving a data analysis challenge, it's often worth looking at your code and thinking about whether or not it's obvious what you've done. If you spend a little time rewriting your code while the ideas are fresh, you can save a lot of time later trying to recreate what your code did.
|
||||
|
|
|
@ -4,13 +4,13 @@ title: Data import
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Data import
|
||||
|
||||
```{r, include = FALSE}
|
||||
library(dplyr)
|
||||
library(readr)
|
||||
```
|
||||
|
||||
# Data import
|
||||
|
||||
## Overview
|
||||
|
||||
You can't apply any of the tools you've applied so far to your own work, unless you can get your own data into R. In this chapter, you'll learn how to import:
|
||||
|
|
|
@ -4,13 +4,13 @@ title: Welcome
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Welcome
|
||||
|
||||
```{r setup, include = FALSE}
|
||||
source("common.R")
|
||||
install.packages <- function(...) invisible()
|
||||
```
|
||||
|
||||
# Welcome
|
||||
|
||||
Data science is an exciting discipline that allows you to turn raw data into understanding, insight, and knowledge. The goal of "R for Data Science" is to introduce you to the most important in R tools that you need to do data science. After reading this book, you'll have the tools to tackle a wide variety of data science challenges, using the best parts of R.
|
||||
|
||||
## What you will learn
|
||||
|
|
|
@ -4,14 +4,14 @@ title: Working with lists
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Lists
|
||||
|
||||
```{r setup, include=FALSE}
|
||||
library(purrr)
|
||||
source("common.R")
|
||||
source("images/embed_jpg.R")
|
||||
```
|
||||
|
||||
# Lists
|
||||
|
||||
In this chapter, you'll learn how to handle lists, the data structure R uses for complex, hierarchical objects. You've already familiar with vectors, R's data structure for 1d objects. Lists extend these ideas to model objects that are like trees. You can create a hierarchical structure with a list because unlike vectors, a list can contain other lists.
|
||||
|
||||
If you've worked with list-like objects before, you're probably familiar with the for loop. I'll talk a little bit about for loops here, but the focus will be functions from the __purrr__ package. purrr makes it easier to work with lists by eliminating common for loop boilerplate so you can focus on the specifics. The apply family of functions in base R (`apply()`, `lapply()`, `tapply()`, etc) solve a similar problem, but purrr is more consistent and easier to learn.
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
---
|
||||
layout: default
|
||||
title: Models assessment
|
||||
title: Model assessment
|
||||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Model assessment
|
||||
|
||||
```{r setup, include=FALSE}
|
||||
library(purrr)
|
||||
set.seed(1014)
|
||||
|
|
|
@ -4,7 +4,7 @@ title: R Markdown
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Communication
|
||||
# RMarkdown
|
||||
|
||||
|
||||
Recommendations for learning more about communication:
|
||||
|
|
|
@ -3,3 +3,5 @@ layout: default
|
|||
title: Shiny
|
||||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Shiny
|
||||
|
|
|
@ -4,6 +4,8 @@ title: String manipulation
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# String manipulation
|
||||
|
||||
```{r setup, include=FALSE}
|
||||
knitr::opts_chunk$set(echo = TRUE)
|
||||
library(stringr)
|
||||
|
@ -15,8 +17,6 @@ sentences <- readr::read_lines("harvard-sentences.txt")
|
|||
|
||||
<!-- look at http://d-rug.github.io/blog/2015/regex.fick/ -->
|
||||
|
||||
# String manipulation
|
||||
|
||||
This chapter introduces you to string manipulation in R. You'll learn the basics of how strings work and how to create them by hand, but the focus of this chapter will be on regular expressions. Character variables typically unstructured or semi-structured data so you need some tools to make order from madness. Regular expressions are a very concise language for describing patterns in strings. When you first look at them, you'll think a cat walked across your keyboard, but as you learn more, you'll see how they allow you to express complex patterns very concisely. The goal of this chapter is not to teach you every detail of regular expressions. Instead we'll give you a solid foundation that allows you to solve a wide variety of problems and point you to resources where you can learn more.
|
||||
|
||||
This chapter will focus on the __stringr__ package. This package provides a consistent set of functions that all work the same way and are easier to learn than the base R equivalents. We'll also take a brief look at the __stringi__ package. This package is what stringr uses internally: it's more complex than stringr (and includes many many more functions). stringr includes tools to let you tackle the most common 90% of string manipulation challenges; stringi contains functions to let you tackle the last 10%.
|
||||
|
|
|
@ -4,14 +4,14 @@ title: Data transformation
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Data transformation {#transform}
|
||||
|
||||
```{r setup, include=FALSE}
|
||||
library(dplyr)
|
||||
library(nycflights13)
|
||||
source("common.R")
|
||||
```
|
||||
|
||||
# Data transformation {#transform}
|
||||
|
||||
When working with data you must:
|
||||
|
||||
* Figure out what you want to do.
|
||||
|
|
|
@ -4,6 +4,8 @@ title: Data Visualization
|
|||
output: bookdown::html_chapter
|
||||
---
|
||||
|
||||
# Data visualisation
|
||||
|
||||
```{r setup, include = FALSE}
|
||||
knitr::opts_chunk$set(
|
||||
cache = TRUE,
|
||||
|
@ -11,8 +13,6 @@ knitr::opts_chunk$set(
|
|||
)
|
||||
```
|
||||
|
||||
# Visualize Data
|
||||
|
||||
> "The simple graph has brought more information to the data analyst’s mind than any other device."---John Tukey
|
||||
|
||||
Visualization makes data decipherable. Have you ever tried to study a table of raw data? You can examine a couple of values at a time, but you cannot attend to many values at once. The data overloads your attention span, which makes it hard to spot patterns in the data. See this for yourself; can you spot the striking relationship between $X$ and $Y$ in the table below?
|
||||
|
|
Loading…
Reference in New Issue