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:
Mine Cetinkaya-Rundel 2023-07-13 11:52:21 -04:00 committed by GitHub
parent 3c75c0d2d2
commit 02651ef846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 63 additions and 97 deletions

View File

@ -1,10 +1,9 @@
# Exploratory data analysis {#sec-exploratory-data-analysis}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -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",

View File

@ -5,10 +5,9 @@ freeze: true
# Arrow {#sec-arrow}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# A field guide to base R {#sec-base-r}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,8 +1,8 @@
# Communicate {#sec-communicate-intro .unnumbered}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
```

View File

@ -1,10 +1,9 @@
# Communication {#sec-communication}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Data import {#sec-data-import}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Data tidying {#sec-data-tidy}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Data transformation {#sec-data-transform}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Data visualization {#sec-data-visualization}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

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

View File

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

View File

@ -1,10 +1,9 @@
# Factors {#sec-factors}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,10 +1,9 @@
# Functions {#sec-functions}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,8 +1,8 @@
# Import {#sec-import .unnumbered}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
```

View File

@ -1,8 +1,8 @@
# Introduction {#sec-intro}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
```

View File

@ -1,11 +1,9 @@
# Iteration {#sec-iteration}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,10 +1,9 @@
# Joins {#sec-joins}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Layers {#sec-layers}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction
@ -1005,14 +1003,16 @@ 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>),
stat = <STAT>,
position = <POSITION>
) +
<COORDINATE_FUNCTION> +
<FACET_FUNCTION>
```
ggplot(data = <DATA>) +
<GEOM_FUNCTION>(
mapping = aes(<MAPPINGS>),
stat = <STAT>,
position = <POSITION>
) +
<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.

View File

@ -1,11 +1,9 @@
# Logical vectors {#sec-logicals}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,10 +1,9 @@
# Missing values {#sec-missing-values}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Numbers {#sec-numbers}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Quarto formats {#sec-quarto-formats}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -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.

View File

@ -1,10 +1,9 @@
# Hierarchical data {#sec-rectangling}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,10 +1,9 @@
# Regular expressions {#sec-regular-expressions}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Spreadsheets {#sec-import-spreadsheets}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -1,11 +1,9 @@
# Strings {#sec-strings}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -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.

View File

@ -1,10 +1,9 @@
# Web scraping {#sec-scraping}
```{r}
#| results: "asis"
#| echo: false
source("_common.R")
status("complete")
```
## Introduction

View File

@ -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
+
```
> 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.

View File

@ -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
```
````
``` 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:

View File

@ -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,15 +123,17 @@ 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
FinalReport.qmd
fig 1.png
Figure_02.png
model_first_try.R
run-first.r
temp.txt
```
alternative model.R
code for exploratory analysis.r
finalreport.qmd
FinalReport.qmd
fig 1.png
Figure_02.png
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,15 +141,17 @@ 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
04-model-approach-2.R
fig-01.png
fig-02.png
report-2022-03-20.qmd
report-2022-04-02.qmd
report-draft-notes.txt
```
01-load-data.R
02-exploratory-analysis.R
03-model-approach-1.R
04-model-approach-2.R
fig-01.png
fig-02.png
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.

View File

@ -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.