From 5d06b2c6d051d67c51c039784dfb34c761cf2a1f Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 18 Nov 2022 15:25:52 -0600 Subject: [PATCH] Mention glimpse --- data-transform.qmd | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/data-transform.qmd b/data-transform.qmd index b0b683b..12a4202 100644 --- a/data-transform.qmd +++ b/data-transform.qmd @@ -47,10 +47,15 @@ flights If you've used R before, you might notice that this data frame prints a little differently to other data frames you've seen. That's because it's a **tibble**, a special type of data frame used by the tidyverse to avoid some common gotchas. The most important difference is the way it prints: tibbles are designed for large datasets, so they only show the first few rows and only the columns that fit on one screen. -To see everything you can use `print(flights, width = Inf)` to show everything in the console, but it's generally more convenient to instead use `View(flights)` to open the dataset in the scrollable RStudio viewer. +There are a few options to see everything. +If you're using RStudio, the most convenient is probably `View(flights)`, which will open an interactive scrollable and filterable view. +Otherwise you can use `print(flights, width = Inf)` to show all columns, or use call `glimpse()`: -You might have noticed the short abbreviations that follow each column name. -These tell you the type of each variable: `` is short for integer, `` is short for double (aka real numbers), `` for character (aka strings), and `` for date-time. +```{r} +glimpse(flights) +``` + +In both views, the variables names are followed by abbreviations that tell you the type of each variable: `` is short for integer, `` is short for double (aka real numbers), `` for character (aka strings), and `` for date-time. These are important because the operations you can perform on a column depend so much on its "type", and these types are used to organize the chapters in the next section of the book. ### dplyr basics