Remove status (#1527)
* Remove status * Remove status, no other changes * Leave a note about how to use status() * Remove status + visual editor made some changes * Remove backticks added by visual editor * Remove whitespaces
This commit is contained in:
parent
3c75c0d2d2
commit
02651ef846
3
EDA.qmd
3
EDA.qmd
|
@ -1,10 +1,9 @@
|
|||
# Exploratory data analysis {#sec-exploratory-data-analysis}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -25,6 +25,7 @@ options(
|
|||
|
||||
ggplot2::theme_set(ggplot2::theme_gray(12))
|
||||
|
||||
# use results: "asis" when setting a status for a chapter
|
||||
status <- function(type) {
|
||||
status <- switch(type,
|
||||
polishing = "should be readable but is currently undergoing final polishing",
|
||||
|
|
|
@ -5,10 +5,9 @@ freeze: true
|
|||
# Arrow {#sec-arrow}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# A field guide to base R {#sec-base-r}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# Communicate {#sec-communicate-intro .unnumbered}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
```
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Communication {#sec-communication}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Data import {#sec-data-import}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Data tidying {#sec-data-tidy}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Data transformation {#sec-data-transform}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Data visualization {#sec-data-visualization}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Databases {#sec-import-databases}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
@ -29,6 +28,7 @@ DBI is a low-level interface that connects to databases and executes SQL; dbplyr
|
|||
```{r}
|
||||
#| label: setup
|
||||
#| message: false
|
||||
|
||||
library(DBI)
|
||||
library(dbplyr)
|
||||
library(tidyverse)
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Dates and times {#sec-dates-and-times}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
|
||||
# https://github.com/tidyverse/lubridate/issues/1058
|
||||
options(warnPartialMatchArgs = FALSE)
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Factors {#sec-factors}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Functions {#sec-functions}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# Import {#sec-import .unnumbered}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
```
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# Introduction {#sec-intro}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
```
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Iteration {#sec-iteration}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Joins {#sec-joins}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Layers {#sec-layers}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
@ -1005,6 +1003,7 @@ There are two other coordinate systems that are occasionally helpful.
|
|||
|
||||
We can expand on the graphing template you learned in @sec-ggplot2-calls by adding position adjustments, stats, coordinate systems, and faceting:
|
||||
|
||||
```
|
||||
ggplot(data = <DATA>) +
|
||||
<GEOM_FUNCTION>(
|
||||
mapping = aes(<MAPPINGS>),
|
||||
|
@ -1013,6 +1012,7 @@ We can expand on the graphing template you learned in @sec-ggplot2-calls by addi
|
|||
) +
|
||||
<COORDINATE_FUNCTION> +
|
||||
<FACET_FUNCTION>
|
||||
```
|
||||
|
||||
Our new template takes seven parameters, the bracketed words that appear in the template.
|
||||
In practice, you rarely need to supply all seven parameters to make a graph because ggplot2 will provide useful defaults for everything except the data, the mappings, and the geom function.
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Logical vectors {#sec-logicals}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Missing values {#sec-missing-values}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Numbers {#sec-numbers}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Quarto formats {#sec-quarto-formats}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Quarto {#sec-quarto}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
@ -118,7 +116,7 @@ This will display the report in the viewer pane as shown in @fig-diamond-sizes-r
|
|||
knitr::include_graphics("quarto/diamond-sizes-report.png")
|
||||
```
|
||||
|
||||
When you render the document, Quarto sends the `.qmd` file to **knitr**, [https://yihui.org/knitr/](https://yihui.org/knitr/){.uri}, which executes all of the code chunks and creates a new markdown (`.md`) document which includes the code and its output.
|
||||
When you render the document, Quarto sends the `.qmd` file to **knitr**, <https://yihui.org/knitr/>, which executes all of the code chunks and creates a new markdown (`.md`) document which includes the code and its output.
|
||||
The markdown file generated by knitr is then processed by **pandoc**, [https://pandoc.org](https://pandoc.org/){.uri}, which is responsible for creating the finished file.
|
||||
This process is shown in @fig-quarto-flow.
|
||||
The advantage of this two step workflow is that you can create a very wide range of output formats, as you'll learn about in @sec-quarto-formats.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Hierarchical data {#sec-rectangling}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Regular expressions {#sec-regular-expressions}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Spreadsheets {#sec-import-spreadsheets}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Strings {#sec-strings}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Visualize {#sec-visualize .unnumbered}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
After reading the first part of the book, you understand (at least superficially) the most important tools for doing data science.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Web scraping {#sec-scraping}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Workflow: basics {#sec-workflow-basics}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
You now have some experience running R code.
|
||||
|
@ -196,8 +194,10 @@ Quotation marks and parentheses must always come in a pair.
|
|||
RStudio does its best to help you, but it's still possible to mess up and end up with a mismatch.
|
||||
If this happens, R will show you the continuation character "+":
|
||||
|
||||
```
|
||||
> x <- "hello
|
||||
+
|
||||
```
|
||||
|
||||
The `+` tells you that R is waiting for more input; it doesn't think you're done yet.
|
||||
Usually, this means you've forgotten either a `"` or a `)`. Either add the missing pair, or press ESCAPE to abort the expression and try again.
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Workflow: getting help {#sec-workflow-getting-help}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
This book is not an island; there is no single resource that will allow you to master R.
|
||||
|
@ -68,11 +66,13 @@ reprex::reprex()
|
|||
A nicely rendered HTML preview will display in RStudio's Viewer (if you're in RStudio) or your default browser otherwise.
|
||||
The reprex is automatically copied to your clipboard (on RStudio Server or Cloud, you will need to copy this yourself):
|
||||
|
||||
````
|
||||
``` r
|
||||
y <- 1:4
|
||||
mean(y)
|
||||
#> [1] 2.5
|
||||
```
|
||||
````
|
||||
|
||||
This text is formatted in a special way, called Markdown, which can be pasted to sites like StackOverflow or Github and they will automatically render it to look like code.
|
||||
Here's what that Markdown would look like rendered on GitHub:
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Workflow: scripts and projects {#sec-workflow-scripts-projects}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
This chapter will introduce you to two essential tools for organizing your code: scripts and projects.
|
||||
|
@ -124,6 +123,7 @@ Three important principles for file naming are as follows:
|
|||
|
||||
For example, suppose you have the following files in a project folder.
|
||||
|
||||
```
|
||||
alternative model.R
|
||||
code for exploratory analysis.r
|
||||
finalreport.qmd
|
||||
|
@ -133,6 +133,7 @@ For example, suppose you have the following files in a project folder.
|
|||
model_first_try.R
|
||||
run-first.r
|
||||
temp.txt
|
||||
```
|
||||
|
||||
There are a variety of problems here: it's hard to find which file to run first, file names contain spaces, there are two files with the same name but different capitalization (`finalreport` vs. `FinalReport`[^workflow-scripts-1]), and some names don't describe their contents (`run-first` and `temp`).
|
||||
|
||||
|
@ -140,6 +141,7 @@ There are a variety of problems here: it's hard to find which file to run first,
|
|||
|
||||
Here's a better way of naming and organizing the same set of files:
|
||||
|
||||
```
|
||||
01-load-data.R
|
||||
02-exploratory-analysis.R
|
||||
03-model-approach-1.R
|
||||
|
@ -149,6 +151,7 @@ Here's a better way of naming and organizing the same set of files:
|
|||
report-2022-03-20.qmd
|
||||
report-2022-04-02.qmd
|
||||
report-draft-notes.txt
|
||||
```
|
||||
|
||||
Numbering the key scripts make it obvious in which order to run them and a consistent naming scheme makes it easier to see what varies.
|
||||
Additionally, the figures are labelled similarly, the reports are distinguished by dates included in the file names, and `temp` is renamed to `report-draft-notes` to better describe its contents.
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Workflow: code style {#sec-workflow-style}
|
||||
|
||||
```{r}
|
||||
#| results: "asis"
|
||||
#| echo: false
|
||||
|
||||
source("_common.R")
|
||||
status("complete")
|
||||
```
|
||||
|
||||
Good coding style is like correct punctuation: you can manage without it, butitsuremakesthingseasiertoread.
|
||||
|
|
Loading…
Reference in New Issue