From a0f9d0d2d62b3a6cff0dcc5681c94b2b7ecc3f3c Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 18 Nov 2022 11:55:22 -0600 Subject: [PATCH] Actually strip status --- _common.R | 7 +++++-- oreilly/EDA.html | 2 +- oreilly/base-R.html | 2 +- oreilly/communicate-plots.html | 2 +- oreilly/data-import.html | 4 ++-- oreilly/data-tidy.html | 2 +- oreilly/data-transform.html | 2 +- oreilly/databases.html | 2 +- oreilly/datetimes.html | 4 ++-- oreilly/factors.html | 2 +- oreilly/functions.html | 2 +- oreilly/iteration.html | 2 +- oreilly/joins.html | 2 +- oreilly/logicals.html | 2 +- oreilly/missing-values.html | 2 +- oreilly/numbers.html | 2 +- oreilly/quarto-formats.html | 2 +- oreilly/quarto-workflow.html | 2 +- oreilly/quarto.html | 2 +- oreilly/rectangling.html | 2 +- oreilly/regexps.html | 2 +- oreilly/spreadsheets.html | 2 +- oreilly/strings.html | 2 +- oreilly/webscraping.html | 2 +- oreilly/workflow-basics.html | 2 +- oreilly/workflow-help.html | 2 +- oreilly/workflow-pipes.html | 2 +- oreilly/workflow-scripts.html | 2 +- oreilly/workflow-style.html | 2 +- 29 files changed, 35 insertions(+), 32 deletions(-) diff --git a/_common.R b/_common.R index 8165433..62c2bec 100644 --- a/_common.R +++ b/_common.R @@ -39,10 +39,13 @@ status <- function(type) { ) cat(paste0( - "::: status callout-", class, "\n", + "\n", + ":::: status\n", + "::: callout-", class, " \n", "You are reading the work-in-progress second edition of R for Data Science. ", "This chapter ", status, ". ", "You can find the complete first edition at .\n", - ":::\n" + ":::\n", + "::::\n" )) } diff --git a/oreilly/EDA.html b/oreilly/EDA.html index b1efa88..cab3edf 100644 --- a/oreilly/EDA.html +++ b/oreilly/EDA.html @@ -1,5 +1,5 @@
-

Exploratory data analysis

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Exploratory data analysis

Introduction

diff --git a/oreilly/base-R.html b/oreilly/base-R.html index faa0fa1..57a3fe8 100644 --- a/oreilly/base-R.html +++ b/oreilly/base-R.html @@ -1,5 +1,5 @@
-

A field guide to base R

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

To finish off the programming section, we’re going to give you a quick tour of the most important base R functions that we don’t otherwise discuss in the book. These tools are particularly useful as you do more programming and will help you read code that you’ll encounter in the wild.

This is a good place to remind you that the tidyverse is not the only way to solve data science problems. We teach the tidyverse in this book because tidyverse packages share a common design philosophy, which increases the consistency across functions, making each new function or package a little easier to learn and use. It’s not possible to use the tidyverse without using base R, so we’ve actually already taught you a lot of base R functions: from library() to load packages, to sum() and mean() for numeric summaries, to the factor, date, and POSIXct data types, and of course all the basic operators like +, -, /, *, |, &, and !. What we haven’t focused on so far is base R workflows, so we will highlight a few of those in this chapter.

After you read this book you’ll learn other approaches to the same problems using base R, data.table, and other packages. You’ll certainly encounter these other approaches when you start reading R code written by other people, particularly if you’re using StackOverflow. It’s 100% okay to write code that uses a mix of approaches, and don’t let anyone tell you otherwise!

In this chapter, we’ll focus on four big topics: subsetting with [, subsetting with [[ and $, the apply family of functions, and for loops. To finish off, we’ll briefly discuss two important plotting functions.

+

A field guide to base R

To finish off the programming section, we’re going to give you a quick tour of the most important base R functions that we don’t otherwise discuss in the book. These tools are particularly useful as you do more programming and will help you read code that you’ll encounter in the wild.

This is a good place to remind you that the tidyverse is not the only way to solve data science problems. We teach the tidyverse in this book because tidyverse packages share a common design philosophy, which increases the consistency across functions, making each new function or package a little easier to learn and use. It’s not possible to use the tidyverse without using base R, so we’ve actually already taught you a lot of base R functions: from library() to load packages, to sum() and mean() for numeric summaries, to the factor, date, and POSIXct data types, and of course all the basic operators like +, -, /, *, |, &, and !. What we haven’t focused on so far is base R workflows, so we will highlight a few of those in this chapter.

After you read this book you’ll learn other approaches to the same problems using base R, data.table, and other packages. You’ll certainly encounter these other approaches when you start reading R code written by other people, particularly if you’re using StackOverflow. It’s 100% okay to write code that uses a mix of approaches, and don’t let anyone tell you otherwise!

In this chapter, we’ll focus on four big topics: subsetting with [, subsetting with [[ and $, the apply family of functions, and for loops. To finish off, we’ll briefly discuss two important plotting functions.

Prerequisites

diff --git a/oreilly/communicate-plots.html b/oreilly/communicate-plots.html index 989ba79..7a38cab 100644 --- a/oreilly/communicate-plots.html +++ b/oreilly/communicate-plots.html @@ -1,5 +1,5 @@
-

Graphics for communication

::: status callout-important You are reading the work-in-progress second edition of R for Data Science. This chapter is currently a dumping ground for ideas, and we don’t recommend reading it. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Graphics for communication

Introduction

diff --git a/oreilly/data-import.html b/oreilly/data-import.html index 51131f1..fe88ec0 100644 --- a/oreilly/data-import.html +++ b/oreilly/data-import.html @@ -1,5 +1,5 @@
-

Data import

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Data import

Introduction

@@ -373,7 +373,7 @@ Missing values, column types, and problems #> # A tibble: 1 × 5 #> row col expected actual file #> <int> <int> <chr> <chr> <chr> -#> 1 3 1 a double . /private/tmp/Rtmpc2nAIe/file8f2f488fc2f4 +#> 1 3 1 a double . /private/tmp/RtmpZYGhlj/file9e8176037b8c

This tells us that there was a problem in row 3, col 1 where readr expected a double but got a .. That suggests this dataset uses . for missing values. So then we set na = ".", the automatic guessing succeeds, giving us the numeric column that we want:

diff --git a/oreilly/data-tidy.html b/oreilly/data-tidy.html index cb9dff4..c6792a7 100644 --- a/oreilly/data-tidy.html +++ b/oreilly/data-tidy.html @@ -1,5 +1,5 @@
-

Data tidying

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter is largely complete and just needs final proof reading. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Data tidying

Introduction

diff --git a/oreilly/data-transform.html b/oreilly/data-transform.html index 0c88ff0..9781ca9 100644 --- a/oreilly/data-transform.html +++ b/oreilly/data-transform.html @@ -1,5 +1,5 @@
-

Data transformation

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Data transformation

Introduction

diff --git a/oreilly/databases.html b/oreilly/databases.html index d22fe20..6c0216f 100644 --- a/oreilly/databases.html +++ b/oreilly/databases.html @@ -1,5 +1,5 @@
-

Databases

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Databases

Introduction

diff --git a/oreilly/datetimes.html b/oreilly/datetimes.html index 21c9b0a..b819865 100644 --- a/oreilly/datetimes.html +++ b/oreilly/datetimes.html @@ -1,5 +1,5 @@
-

Dates and times

::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

+

Dates and times

Introduction

@@ -35,7 +35,7 @@ Creating date/times
today()
 #> [1] "2022-11-18"
 now()
-#> [1] "2022-11-18 10:59:07 CST"
+#> [1] "2022-11-18 11:36:09 CST"

Otherwise, the following sections describe the four ways you’re likely to create a date/time:

  • While reading a file with readr.
  • diff --git a/oreilly/factors.html b/oreilly/factors.html index bb2c4ec..4a6a261 100644 --- a/oreilly/factors.html +++ b/oreilly/factors.html @@ -1,5 +1,5 @@
    -

    Factors

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter is largely complete and just needs final proof reading. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Factors

    Introduction

    diff --git a/oreilly/functions.html b/oreilly/functions.html index e160379..87c635b 100644 --- a/oreilly/functions.html +++ b/oreilly/functions.html @@ -1,5 +1,5 @@
    -

    Functions

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Functions

    Introduction

    diff --git a/oreilly/iteration.html b/oreilly/iteration.html index b8b782f..02a6fad 100644 --- a/oreilly/iteration.html +++ b/oreilly/iteration.html @@ -1,5 +1,5 @@
    -

    Iteration

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Iteration

    Introduction

    diff --git a/oreilly/joins.html b/oreilly/joins.html index ea58ddc..b1ff18d 100644 --- a/oreilly/joins.html +++ b/oreilly/joins.html @@ -1,5 +1,5 @@
    -

    Joins

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Joins

    Introduction

    diff --git a/oreilly/logicals.html b/oreilly/logicals.html index d48cff5..faf88d4 100644 --- a/oreilly/logicals.html +++ b/oreilly/logicals.html @@ -1,5 +1,5 @@
    -

    Logical vectors

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Logical vectors

    Introduction

    diff --git a/oreilly/missing-values.html b/oreilly/missing-values.html index 51a1ab9..9d82cdc 100644 --- a/oreilly/missing-values.html +++ b/oreilly/missing-values.html @@ -1,5 +1,5 @@
    -

    Missing values

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Missing values

    Introduction

    diff --git a/oreilly/numbers.html b/oreilly/numbers.html index 6275ae6..50aee09 100644 --- a/oreilly/numbers.html +++ b/oreilly/numbers.html @@ -1,5 +1,5 @@
    -

    Numbers

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Numbers

    Introduction

    diff --git a/oreilly/quarto-formats.html b/oreilly/quarto-formats.html index e5e2f67..494ac5f 100644 --- a/oreilly/quarto-formats.html +++ b/oreilly/quarto-formats.html @@ -1,5 +1,5 @@
    -

    Quarto formats

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    +

    Quarto formats

    Introduction

    diff --git a/oreilly/quarto-workflow.html b/oreilly/quarto-workflow.html index ce9416e..703dc5a 100644 --- a/oreilly/quarto-workflow.html +++ b/oreilly/quarto-workflow.html @@ -1,5 +1,5 @@
    -

    Quarto workflow

    ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

    Earlier, we discussed a basic workflow for capturing your R code where you work interactively in the console, then capture what works in the script editor. Quarto brings together the console and the script editor, blurring the lines between interactive exploration and long-term code capture. You can rapidly iterate within a chunk, editing and re-executing with Cmd/Ctrl + Shift + Enter. When you’re happy, you move on and start a new chunk.

    Quarto is also important because it so tightly integrates prose and code. This makes it a great analysis notebook because it lets you develop code and record your thoughts. An analysis notebook shares many of the same goals as a classic lab notebook in the physical sciences. It:

    • Records what you did and why you did it. Regardless of how great your memory is, if you don’t record what you do, there will come a time when you have forgotten important details. Write them down so you don’t forget!

    • +

      Quarto workflow

      Earlier, we discussed a basic workflow for capturing your R code where you work interactively in the console, then capture what works in the script editor. Quarto brings together the console and the script editor, blurring the lines between interactive exploration and long-term code capture. You can rapidly iterate within a chunk, editing and re-executing with Cmd/Ctrl + Shift + Enter. When you’re happy, you move on and start a new chunk.

      Quarto is also important because it so tightly integrates prose and code. This makes it a great analysis notebook because it lets you develop code and record your thoughts. An analysis notebook shares many of the same goals as a classic lab notebook in the physical sciences. It:

      • Records what you did and why you did it. Regardless of how great your memory is, if you don’t record what you do, there will come a time when you have forgotten important details. Write them down so you don’t forget!

      • Supports rigorous thinking. You are more likely to come up with a strong analysis if you record your thoughts as you go, and continue to reflect on them. This also saves you time when you eventually write up your analysis to share with others.

      • Helps others understand your work. It is rare to do data analysis by yourself, and you’ll often be working as part of a team. A lab notebook helps you share not only what you’ve done, but why you did it with your colleagues or lab mates.

      Much of the good advice about using lab notebooks effectively can also be translated to analysis notebooks. We’ve drawn on our own experiences and Colin Purrington’s advice on lab notebooks (https://colinpurrington.com/tips/lab-notebooks) to come up with the following tips:

      • Ensure each notebook has a descriptive title, an evocative file name, and a first paragraph that briefly describes the aims of the analysis.

      • diff --git a/oreilly/quarto.html b/oreilly/quarto.html index c725c8e..4d4193a 100644 --- a/oreilly/quarto.html +++ b/oreilly/quarto.html @@ -1,5 +1,5 @@
        -

        Quarto

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        +

        Quarto

        Introduction

        diff --git a/oreilly/rectangling.html b/oreilly/rectangling.html index ce6d7ee..ebc43c4 100644 --- a/oreilly/rectangling.html +++ b/oreilly/rectangling.html @@ -1,5 +1,5 @@
        -

        Data rectangling

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        +

        Data rectangling

        Introduction

        diff --git a/oreilly/regexps.html b/oreilly/regexps.html index 7600d9b..4fab906 100644 --- a/oreilly/regexps.html +++ b/oreilly/regexps.html @@ -1,5 +1,5 @@
        -

        Regular expressions

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        +

        Regular expressions

        Introduction

        diff --git a/oreilly/spreadsheets.html b/oreilly/spreadsheets.html index 284ba3e..80632fd 100644 --- a/oreilly/spreadsheets.html +++ b/oreilly/spreadsheets.html @@ -1,5 +1,5 @@
        -

        Spreadsheets

        ::: status callout-important You are reading the work-in-progress second edition of R for Data Science. This chapter is currently a dumping ground for ideas, and we don’t recommend reading it. You can find the complete first edition at https://r4ds.had.co.nz. :::

        +

        Spreadsheets

        Introduction

        diff --git a/oreilly/strings.html b/oreilly/strings.html index 9da517e..ed10898 100644 --- a/oreilly/strings.html +++ b/oreilly/strings.html @@ -1,5 +1,5 @@
        -

        Strings

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        +

        Strings

        Introduction

        diff --git a/oreilly/webscraping.html b/oreilly/webscraping.html index 1f86955..9cb29a4 100644 --- a/oreilly/webscraping.html +++ b/oreilly/webscraping.html @@ -1,2 +1,2 @@
        -

        Web scraping

        ::: status callout-important You are reading the work-in-progress second edition of R for Data Science. This chapter is currently a dumping ground for ideas, and we don’t recommend reading it. You can find the complete first edition at https://r4ds.had.co.nz. :::

        +

        Web scraping

        diff --git a/oreilly/workflow-basics.html b/oreilly/workflow-basics.html index 9014458..b4a5e0d 100644 --- a/oreilly/workflow-basics.html +++ b/oreilly/workflow-basics.html @@ -1,5 +1,5 @@
        -

        Workflow: basics

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        You now have some experience running R code. We didn’t give you many details, but you’ve obviously figured out the basics, or you would’ve thrown this book away in frustration! Frustration is natural when you start programming in R, because it is such a stickler for punctuation, and even one character out of place will cause it to complain. But while you should expect to be a little frustrated, take comfort in that this experience is both typical and temporary: it happens to everyone, and the only way to get over it is to keep trying.

        Before we go any further, let’s make sure you’ve got a solid foundation in running R code, and that you know about some of the most helpful RStudio features.

        +

        Workflow: basics

        You now have some experience running R code. We didn’t give you many details, but you’ve obviously figured out the basics, or you would’ve thrown this book away in frustration! Frustration is natural when you start programming in R, because it is such a stickler for punctuation, and even one character out of place will cause it to complain. But while you should expect to be a little frustrated, take comfort in that this experience is both typical and temporary: it happens to everyone, and the only way to get over it is to keep trying.

        Before we go any further, let’s make sure you’ve got a solid foundation in running R code, and that you know about some of the most helpful RStudio features.

        Coding basics

        diff --git a/oreilly/workflow-help.html b/oreilly/workflow-help.html index 4582888..1edfdaf 100644 --- a/oreilly/workflow-help.html +++ b/oreilly/workflow-help.html @@ -1,5 +1,5 @@
        -

        Workflow: Getting help

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        This book is not an island; there is no single resource that will allow you to master R. As you begin to apply the techniques described in this book to your own data, you will soon find questions that we do not answer. This section describes a few tips on how to get help, and to help you keep learning.

        +

        Workflow: Getting help

        This book is not an island; there is no single resource that will allow you to master R. As you begin to apply the techniques described in this book to your own data, you will soon find questions that we do not answer. This section describes a few tips on how to get help, and to help you keep learning.

        Google is your friend

        diff --git a/oreilly/workflow-pipes.html b/oreilly/workflow-pipes.html index 0db56c4..dfbefa9 100644 --- a/oreilly/workflow-pipes.html +++ b/oreilly/workflow-pipes.html @@ -1,5 +1,5 @@
        -

        Workflow: Pipes

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter is largely complete and just needs final proof reading. You can find the complete first edition at https://r4ds.had.co.nz. :::

        The pipe, |>, is a powerful tool for clearly expressing a sequence of operations that transform an object. We briefly introduced pipes in the previous chapter, but before going too much farther, we want to give a few more details and discuss %>%, a predecessor to |>.

        To add the pipe to your code, we recommend using the build-in keyboard shortcut Ctrl/Cmd + Shift + M. You’ll need to make one change to your RStudio options to use |> instead of %>% as shown in #fig-pipe-options; more on %>% shortly.

        +

        Workflow: Pipes

        The pipe, |>, is a powerful tool for clearly expressing a sequence of operations that transform an object. We briefly introduced pipes in the previous chapter, but before going too much farther, we want to give a few more details and discuss %>%, a predecessor to |>.

        To add the pipe to your code, we recommend using the build-in keyboard shortcut Ctrl/Cmd + Shift + M. You’ll need to make one change to your RStudio options to use |> instead of %>% as shown in #fig-pipe-options; more on %>% shortly.

        Screenshot showing the "Use native pipe operator" option which can be found on the "Editing" panel of the "Code" options.

        diff --git a/oreilly/workflow-scripts.html b/oreilly/workflow-scripts.html index 9ea61e9..b87ac0a 100644 --- a/oreilly/workflow-scripts.html +++ b/oreilly/workflow-scripts.html @@ -1,5 +1,5 @@
        -

        Workflow: scripts and projects

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        This chapter will introduce you to two very important tools for organizing your code: scripts and projects.

        +

        Workflow: scripts and projects

        This chapter will introduce you to two very important tools for organizing your code: scripts and projects.

        Scripts

        diff --git a/oreilly/workflow-style.html b/oreilly/workflow-style.html index cd94932..3d40d63 100644 --- a/oreilly/workflow-style.html +++ b/oreilly/workflow-style.html @@ -1,5 +1,5 @@
        -

        Workflow: code style

        ::: status callout-note You are reading the work-in-progress second edition of R for Data Science. This chapter should be readable but is currently undergoing final polishing. You can find the complete first edition at https://r4ds.had.co.nz. :::

        Good coding style is like correct punctuation: you can manage without it, butitsuremakesthingseasiertoread. Even as a very new programmer it’s a good idea to work on your code style. Using a consistent style makes it easier for others (including future-you!) to read your work, and is particularly important if you need to get help from someone else. This chapter will introduce to the most important points of the tidyverse style guide, which is used throughout this book.

        Styling your code will feel a bit tedious to start with, but if you practice it, it will soon become second nature. Additionally, there are some great tools to quickly restyle existing code, like the styler package by Lorenz Walthert. Once you’ve installed it with install.packages("styler"), an easy way to use it is via RStudio’s command palette. The command palette lets you use any build-in RStudio command, as well as many addins provided by packages. Open the palette by pressing Cmd/Ctrl + Shift + P, then type “styler” to see all the shortcuts provided by styler. #fig-styler shows the results.

        +

        Workflow: code style

        Good coding style is like correct punctuation: you can manage without it, butitsuremakesthingseasiertoread. Even as a very new programmer it’s a good idea to work on your code style. Using a consistent style makes it easier for others (including future-you!) to read your work, and is particularly important if you need to get help from someone else. This chapter will introduce to the most important points of the tidyverse style guide, which is used throughout this book.

        Styling your code will feel a bit tedious to start with, but if you practice it, it will soon become second nature. Additionally, there are some great tools to quickly restyle existing code, like the styler package by Lorenz Walthert. Once you’ve installed it with install.packages("styler"), an easy way to use it is via RStudio’s command palette. The command palette lets you use any build-in RStudio command, as well as many addins provided by packages. Open the palette by pressing Cmd/Ctrl + Shift + P, then type “styler” to see all the shortcuts provided by styler. #fig-styler shows the results.

        A screenshot showing the command palette after typing "styler", showing the four styling tool provided by the package.