diff --git a/.nojekyll b/.nojekyll index 82c2e4066..bdd080be2 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -7604c4b1 \ No newline at end of file +dfddee1e \ No newline at end of file diff --git a/EDA.html b/EDA.html index 4215b2053..8b9e7f43e 100644 --- a/EDA.html +++ b/EDA.html @@ -443,7 +443,17 @@

+
+
+
+ +
+
+

Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

+
+
+
+

10.1 Introduction

This chapter will show you how to use visualization and transformation to explore your data in a systematic way, a task that statisticians call exploratory data analysis, or EDA for short. EDA is an iterative cycle. You:

    diff --git a/base-R.html b/base-R.html index b17a7b0ef..b01fffe91 100644 --- a/base-R.html +++ b/base-R.html @@ -440,7 +440,17 @@

    -

    +
    +
    +
    + +
    +
    +

    Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
    Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
    A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

    +
    +
    +
    +

    27.1 Introduction

    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 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, increasing the consistency across functions, and 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.

    diff --git a/communication.html b/communication.html index 6cab37b07..96034790d 100644 --- a/communication.html +++ b/communication.html @@ -454,7 +454,17 @@

    -

    +
    +
    +
    + +
    +
    +

    Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
    Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
    A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

    +
    +
    +
    +

    11.1 Introduction

    In Capítulo 10, you learned how to use plots as tools for exploration. When you make exploratory plots, you know—even before looking—which variables the plot will display. You made each plot for a purpose, could quickly look at it, and then move on to the next plot. In the course of most analyses, you’ll produce tens or hundreds of plots, most of which are immediately thrown away.

    Now that you understand your data, you need to communicate your understanding to others. Your audience will likely not share your background knowledge and will not be deeply invested in the data. To help others quickly build up a good mental model of the data, you will need to invest considerable effort in making your plots as self-explanatory as possible. In this chapter, you’ll learn some of the tools that ggplot2 provides to do so.

    diff --git a/data-import.html b/data-import.html index c7cb2ab14..4345f5c29 100644 --- a/data-import.html +++ b/data-import.html @@ -439,7 +439,17 @@

    < -

    +
    +
    +
    + +
    +
    +

    Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
    Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
    A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

    +
    +
    +
    +

    7.1 Introduction

    Working with data provided by R packages is a great way to learn data science tools, but you want to apply what you’ve learned to your own data at some point. In this chapter, you’ll learn the basics of reading data files into R.

    Specifically, this chapter will focus on reading plain-text rectangular files. We’ll start with practical advice for handling features like column names, types, and missing data. You will then learn about reading data from multiple files at once and writing data from R to a file. Finally, you’ll learn how to handcraft data frames in R.

    @@ -825,7 +835,7 @@

    < #> # A tibble: 1 × 5 #> row col expected actual file #> <int> <int> <chr> <chr> <chr> -#> 1 3 1 a double . /tmp/Rtmp7ye2gf/file228416ab4e78 +#> 1 3 1 a double . /tmp/RtmprQ7oUD/file1e2549f0663d

    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/data-tidy.html b/data-tidy.html index 912802dcf..d640aa754 100644 --- a/data-tidy.html +++ b/data-tidy.html @@ -440,7 +440,17 @@

    -

    +
    +
    +
    + +
    +
    +

    Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
    Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
    A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

    +
    +
    +
    +

    5.1 Introduction

    “Happy families are all alike; every unhappy family is unhappy in its own way.”
    diff --git a/data-transform.html b/data-transform.html index 2de77e139..5991ba60f 100644 --- a/data-transform.html +++ b/data-transform.html @@ -455,7 +455,17 @@

    +
    +
    +
    + +
    +
    +

    Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
    Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
    A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

    +
    +
    +
    +

    3.1 Introduction

    Visualization is an important tool for generating insight, but it’s rare that you get the data in exactly the right form you need to make the graph you want. Often you’ll need to create some new variables or summaries to answer your questions with your data, or maybe you just want to rename the variables or reorder the observations to make the data a little easier to work with. You’ll learn how to do all that (and more!) in this chapter, which will introduce you to data transformation using the dplyr package and a new dataset on flights that departed from New York City in 2013.

    The goal of this chapter is to give you an overview of all the key tools for transforming a data frame. We’ll start with functions that operate on rows and then columns of a data frame, then circle back to talk more about the pipe, an important tool that you use to combine verbs. We will then introduce the ability to work with groups. We will end the chapter with a case study that showcases these functions in action and we’ll come back to the functions in more detail in later chapters, as we start to dig into specific types of data (e.g., numbers, strings, dates).

    diff --git a/databases.html b/databases.html index 28df27ac5..b6d6cb3ad 100644 --- a/databases.html +++ b/databases.html @@ -445,7 +445,17 @@

    +
    +
    +
    + +
    +
    +

    Olá! Este capítulo do livro ainda não está traduzido para a versão Português-BR.
    Caso você queira contribuir com o projeto de tradução, leia as instruções em: https://github.com/cienciadedatos/pt-r4ds/wiki
    A versão original (em inglês) do livro R for Data Science está disponível em: https://r4ds.hadley.nz/

    +
    +
    +
    +

    21.1 Introduction

    A huge amount of data lives in databases, so it’s essential that you know how to access it. Sometimes you can ask someone to download a snapshot into a .csv for you, but this gets painful quickly: every time you need to make a change you’ll have to communicate with another human. You want to be able to reach into the database directly to get the data you need, when you need it.

    In this chapter, you’ll first learn the basics of the DBI package: how to use it to connect to a database and then retrieve data with a SQL1 query. SQL, short for structured query language, is the lingua franca of databases, and is an important language for all data scientists to learn. That said, we’re not going to start with SQL, but instead we’ll teach you dbplyr, which can translate your dplyr code to the SQL. We’ll use that as a way to teach you some of the most important features of SQL. You won’t become a SQL master by the end of the chapter, but you will be able to identify the most important components and understand what they do.

    @@ -563,7 +573,7 @@

    diamonds_db <- tbl(con, "diamonds")
     diamonds_db
     #> # Source:   table<diamonds> [?? x 10]
    -#> # Database: DuckDB v0.9.1 [unknown@Linux 6.2.0-1015-azure:R 4.3.2/:memory:]
    +#> # Database: DuckDB v0.9.1 [unknown@Linux 6.2.0-1016-azure:R 4.3.2/:memory:]
     #>   carat cut       color clarity depth table price     x     y     z
     #>   <dbl> <fct>     <fct> <fct>   <dbl> <dbl> <int> <dbl> <dbl> <dbl>
     #> 1  0.23 Ideal     E     SI2      61.5    55   326  3.95  3.98  2.43
    @@ -600,7 +610,7 @@ 

    big_diamonds_db #> # Source: SQL [?? x 5] -#> # Database: DuckDB v0.9.1 [unknown@Linux 6.2.0-1015-azure:R 4.3.2/:memory:] +#> # Database: DuckDB v0.9.1 [unknown@Linux 6.2.0-1016-azure:R 4.3.2/:memory:] #> carat cut color clarity price #> <dbl> <fct> <fct> <fct> <int> #> 1 1.54 Premium E VS2 15002 @@ -828,7 +838,7 @@

    #> Use `na.rm = TRUE` to silence this warning #> This warning is displayed once every 8 hours. #> # Source: SQL [?? x 2] -#> # Database: DuckDB v0.9.1 [unknown@Linux 6.2.0-1015-azure:R 4.3.2/:memory:] +#> # Database: DuckDB v0.9.1 [unknown@Linux 6.2.0-1016-azure:R 4.3.2/:memory:] #> dest delay #> <chr> <dbl> #> 1 SFO 2.67 diff --git a/datetimes.html b/datetimes.html index 731ff7750..b6463b45d 100644 --- a/datetimes.html +++ b/datetimes.html @@ -448,7 +448,17 @@

    +
    +
    +
    
    +::: {.callout-warning} 
    +Olá! Este capítulo do livro ainda **não está traduzido** para a versão Português-BR.
    + <br> Caso você queira contribuir com o projeto de tradução, leia as instruções em: <https://github.com/cienciadedatos/pt-r4ds/wiki> <br> 
    +A versão original (em inglês) do livro R for Data Science está disponível em: <https://r4ds.hadley.nz/> 
    +:::
    +
    +
    +

    17.1 Introduction

    This chapter will show you how to work with dates and times in R. At first glance, dates and times seem simple. You use them all the time in your regular life, and they don’t seem to cause much confusion. However, the more you learn about dates and times, the more complicated they seem to get!

    To warm up think about how many days there are in a year, and how many hours there are in a day. You probably remembered that most years have 365 days, but leap years have 366. Do you know the full rule for determining if a year is a leap year1? The number of hours in a day is a little less obvious: most days have 24 hours, but in places that use daylight saving time (DST), one day each year has 23 hours and another has 25.

    @@ -458,7 +468,7 @@

    17.1.1 Prerequisites

    This chapter will focus on the lubridate package, which makes it easier to work with dates and times in R. As of the latest tidyverse release, lubridate is part of core tidyverse. We will also need nycflights13 for practice data.

    @@ -473,10 +483,10 @@

    today() or now():

    -
    today()
    +
    today()
     #> [1] "2023-11-17"
     now()
    -#> [1] "2023-11-17 17:43:56 UTC"
    +#> [1] "2023-11-17 21:36:55 UTC"

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

      @@ -489,7 +499,7 @@

      17.2.1 During import

      If your CSV contains an ISO8601 date or date-time, you don’t need to do anything; readr will automatically recognize it:

      -
      csv <- "
      +
      csv <- "
         date,datetime
         2022-01-02,2022-01-02 05:12
       "
      @@ -618,7 +628,7 @@ 

      -
      csv <- "
      +
      csv <- "
         date
         01/02/15
       "
      @@ -647,7 +657,7 @@ 

      17.2.2 From strings

      The date-time specification language is powerful, but requires careful analysis of the date format. An alternative approach is to use lubridate’s helpers which attempt to automatically determine the format once you specify the order of the component. To use them, identify the order in which year, month, and day appear in your dates, then arrange “y”, “m”, and “d” in the same order. That gives you the name of the lubridate function that will parse your date. For example:

      -
      ymd("2017-01-31")
      +
      ymd("2017-01-31")
       #> [1] "2017-01-31"
       mdy("January 31st, 2017")
       #> [1] "2017-01-31"
      @@ -656,14 +666,14 @@ 

      ymd() and friends create dates. To create a date-time, add an underscore and one or more of “h”, “m”, and “s” to the name of the parsing function:

      -
      ymd_hms("2017-01-31 20:11:59")
      +
      ymd_hms("2017-01-31 20:11:59")
       #> [1] "2017-01-31 20:11:59 UTC"
       mdy_hm("01/31/2017 08:01")
       #> [1] "2017-01-31 08:01:00 UTC"

      You can also force the creation of a date-time from a date by supplying a timezone:

      -
      ymd("2017-01-31", tz = "UTC")
      +
      ymd("2017-01-31", tz = "UTC")
       #> [1] "2017-01-31 UTC"

      Here I use the UTC3 timezone which you might also know as GMT, or Greenwich Mean Time, the time at 0° longitude4 . It doesn’t use daylight saving time, making it a bit easier to compute with .

      @@ -671,7 +681,7 @@

      17.2.3 From individual components

      Instead of a single string, sometimes you’ll have the individual components of the date-time spread across multiple columns. This is what we have in the flights data:

      -
      flights |> 
      +
      flights |> 
         select(year, month, day, hour, minute)
       #> # A tibble: 336,776 × 5
       #>    year month   day  hour minute
      @@ -686,7 +696,7 @@ 

      make_date() for dates, or make_datetime() for date-times:

      -
      flights |> 
      +
      flights |> 
         select(year, month, day, hour, minute) |> 
         mutate(departure = make_datetime(year, month, day, hour, minute))
       #> # A tibble: 336,776 × 6
      @@ -702,7 +712,7 @@ 

      -
      make_datetime_100 <- function(year, month, day, time) {
      +
      make_datetime_100 <- function(year, month, day, time) {
         make_datetime(year, month, day, time %/% 100, time %% 100)
       }
       
      @@ -731,7 +741,7 @@ 

      -
      flights_dt |> 
      +
      flights_dt |> 
         ggplot(aes(x = dep_time)) + 
         geom_freqpoly(binwidth = 86400) # 86400 seconds = 1 day
      @@ -740,7 +750,7 @@

      -
      flights_dt |> 
      +
      flights_dt |> 
         filter(dep_time < ymd(20130102)) |> 
         ggplot(aes(x = dep_time)) + 
         geom_freqpoly(binwidth = 600) # 600 s = 10 minutes
      @@ -753,14 +763,14 @@

      17.2.4 From other types

      You may want to switch between a date-time and a date. That’s the job of as_datetime() and as_date():

      -
      as_datetime(today())
      +
      as_datetime(today())
       #> [1] "2023-11-17 UTC"
       as_date(now())
       #> [1] "2023-11-17"

      Sometimes you’ll get date/times as numeric offsets from the “Unix Epoch”, 1970-01-01. If the offset is in seconds, use as_datetime(); if it’s in days, use as_date().

      -
      as_datetime(60 * 60 * 10)
      +
      as_datetime(60 * 60 * 10)
       #> [1] "1970-01-01 10:00:00 UTC"
       as_date(365 * 10 + 2)
       #> [1] "1980-01-01"
      @@ -771,14 +781,14 @@

      -
      ymd(c("2010-10-10", "bananas"))
      +
      ymd(c("2010-10-10", "bananas"))

    • What does the tzone argument to today() do? Why is it important?

    • For each of the following date-times, show how you’d parse it using a readr column specification and a lubridate function.

      -
      d1 <- "January 1, 2010"
      +
      d1 <- "January 1, 2010"
       d2 <- "2015-Mar-07"
       d3 <- "06-Jun-2017"
       d4 <- c("August 19 (2015)", "July 1 (2015)")
      @@ -794,7 +804,7 @@ 

      17.3.1 Getting components

      You can pull out individual parts of the date with the accessor functions year(), month(), mday() (day of the month), yday() (day of the year), wday() (day of the week), hour(), minute(), and second(). These are effectively the opposites of make_datetime().

      -
      datetime <- ymd_hms("2026-07-08 12:34:56")
      +
      datetime <- ymd_hms("2026-07-08 12:34:56")
       
       year(datetime)
       #> [1] 2026
      @@ -810,7 +820,7 @@ 

      month() and wday() you can set label = TRUE to return the abbreviated name of the month or day of the week. Set abbr = FALSE to return the full name.

      -
      month(datetime, label = TRUE)
      +
      month(datetime, label = TRUE)
       #> [1] Jul
       #> 12 Levels: Jan < Feb < Mar < Apr < May < Jun < Jul < Aug < Sep < ... < Dec
       wday(datetime, label = TRUE, abbr = FALSE)
      @@ -819,7 +829,7 @@ 

      wday() to see that more flights depart during the week than on the weekend:

      -
      flights_dt |> 
      +
      flights_dt |> 
         mutate(wday = wday(dep_time, label = TRUE)) |> 
         ggplot(aes(x = wday)) +
         geom_bar()
      @@ -829,7 +839,7 @@

      -
      flights_dt |> 
      +
      flights_dt |> 
         mutate(minute = minute(dep_time)) |> 
         group_by(minute) |> 
         summarize(
      @@ -844,7 +854,7 @@ 

      -
      sched_dep <- flights_dt |> 
      +
      sched_dep <- flights_dt |> 
         mutate(minute = minute(sched_dep_time)) |> 
         group_by(minute) |> 
         summarize(
      @@ -871,7 +881,7 @@ 

      17.3.2 Rounding

      An alternative approach to plotting individual components is to round the date to a nearby unit of time, with floor_date(), round_date(), and ceiling_date(). Each function takes a vector of dates to adjust and then the name of the unit to round down (floor), round up (ceiling), or round to. This, for example, allows us to plot the number of flights per week:

      -
      flights_dt |> 
      +
      flights_dt |> 
         count(week = floor_date(dep_time, "week")) |> 
         ggplot(aes(x = week, y = n)) +
         geom_line() + 
      @@ -882,7 +892,7 @@ 

      -
      flights_dt |> 
      +
      flights_dt |> 
         mutate(dep_hour = dep_time - floor_date(dep_time, "day")) |> 
         ggplot(aes(x = dep_hour)) +
         geom_freqpoly(binwidth = 60 * 30)
      @@ -894,7 +904,7 @@ 

      Seção 17.4.3). We can convert that to an hms object to get a more useful x-axis:

      -
      flights_dt |> 
      +
      flights_dt |> 
         mutate(dep_hour = hms::as_hms(dep_time - floor_date(dep_time, "day"))) |> 
         ggplot(aes(x = dep_hour)) +
         geom_freqpoly(binwidth = 60 * 30)
      @@ -906,7 +916,7 @@

      17.3.3 Modifying components

      You can also use each accessor function to modify the components of a date/time. This doesn’t come up much in data analysis, but can be useful when cleaning data that has clearly incorrect dates.

      -
      (datetime <- ymd_hms("2026-07-08 12:34:56"))
      +
      (datetime <- ymd_hms("2026-07-08 12:34:56"))
       #> [1] "2026-07-08 12:34:56 UTC"
       
       year(datetime) <- 2030
      @@ -921,12 +931,12 @@ 

      update(). This also allows you to set multiple values in one step:

      -
      update(datetime, year = 2030, month = 2, mday = 2, hour = 2)
      +
      update(datetime, year = 2030, month = 2, mday = 2, hour = 2)
       #> [1] "2030-02-02 02:34:56 UTC"

      If values are too big, they will roll-over:

      -
      update(ymd("2023-02-01"), mday = 30)
      +
      update(ymd("2023-02-01"), mday = 30)
       #> [1] "2023-03-02"
       update(ymd("2023-02-01"), hour = 400)
       #> [1] "2023-02-17 16:00:00 UTC"
      @@ -957,19 +967,19 @@

      17.4.1 Durations

      In R, when you subtract two dates, you get a difftime object:

      -
      # How old is Hadley?
      +
      # How old is Hadley?
       h_age <- today() - ymd("1979-10-14")
       h_age
       #> Time difference of 16105 days

      A difftime class object records a time span of seconds, minutes, hours, days, or weeks. This ambiguity can make difftimes a little painful to work with, so lubridate provides an alternative which always uses seconds: the duration.

      -
      as.duration(h_age)
      +
      as.duration(h_age)
       #> [1] "1391472000s (~44.09 years)"

      Durations come with a bunch of convenient constructors:

      -
      dseconds(15)
      +
      dseconds(15)
       #> [1] "15s"
       dminutes(10)
       #> [1] "600s (~10 minutes)"
      @@ -986,19 +996,19 @@ 

      -
      2 * dyears(1)
      +
      2 * dyears(1)
       #> [1] "63115200s (~2 years)"
       dyears(1) + dweeks(12) + dhours(15)
       #> [1] "38869200s (~1.23 years)"

      You can add and subtract durations to and from days:

      -
      tomorrow <- today() + ddays(1)
      +
      tomorrow <- today() + ddays(1)
       last_year <- today() - dyears(1)

      However, because durations represent an exact number of seconds, sometimes you might get an unexpected result:

      -
      one_am <- ymd_hms("2026-03-08 01:00:00", tz = "America/New_York")
      +
      one_am <- ymd_hms("2026-03-08 01:00:00", tz = "America/New_York")
       
       one_am
       #> [1] "2026-03-08 01:00:00 EST"
      @@ -1010,14 +1020,14 @@ 

      17.4.2 Periods

      To solve this problem, lubridate provides periods. Periods are time spans but don’t have a fixed length in seconds, instead they work with “human” times, like days and months. That allows them to work in a more intuitive way:

      -
      one_am
      +
      one_am
       #> [1] "2026-03-08 01:00:00 EST"
       one_am + days(1)
       #> [1] "2026-03-09 01:00:00 EDT"

      Like durations, periods can be created with a number of friendly constructor functions.

      -
      hours(c(12, 24))
      +
      hours(c(12, 24))
       #> [1] "12H 0M 0S" "24H 0M 0S"
       days(7)
       #> [1] "7d 0H 0M 0S"
      @@ -1027,14 +1037,14 @@ 

      -
      10 * (months(6) + days(1))
      +
      10 * (months(6) + days(1))
       #> [1] "60m 10d 0H 0M 0S"
       days(50) + hours(25) + minutes(2)
       #> [1] "50d 25H 2M 0S"

      And of course, add them to dates. Compared to durations, periods are more likely to do what you expect:

      -
      # A leap year
      +
      # A leap year
       ymd("2024-01-01") + dyears(1)
       #> [1] "2024-12-31 06:00:00 UTC"
       ymd("2024-01-01") + years(1)
      @@ -1048,7 +1058,7 @@ 

      -
      flights_dt |> 
      +
      flights_dt |> 
         filter(arr_time < dep_time) 
       #> # A tibble: 10,633 × 9
       #>   origin dest  dep_delay arr_delay dep_time            sched_dep_time     
      @@ -1064,7 +1074,7 @@ 

      -
      flights_dt <- flights_dt |> 
      +
      flights_dt <- flights_dt |> 
         mutate(
           overnight = arr_time < dep_time,
           arr_time = arr_time + days(overnight),
      @@ -1073,7 +1083,7 @@ 

      -
      flights_dt |> 
      +
      flights_dt |> 
         filter(arr_time < dep_time) 
       #> # A tibble: 0 × 10
       #> # ℹ 10 variables: origin <chr>, dest <chr>, dep_delay <dbl>,
      @@ -1084,13 +1094,13 @@ 

      dyears() is defined as the number of seconds per average year, which is 365.25 days.

      What does years(1) / days(1) return? Well, if the year was 2015 it should return 365, but if it was 2016, it should return 366! There’s not quite enough information for lubridate to give a single clear answer. What it does instead is give an estimate:

      -
      years(1) / days(1)
      +
      years(1) / days(1)
       #> [1] 365.25

      If you want a more accurate measurement, you’ll have to use an interval. An interval is a pair of starting and ending date times, or you can think of it as a duration with a starting point.

      You can create an interval by writing start %--% end:

      -
      y2023 <- ymd("2023-01-01") %--% ymd("2024-01-01")
      +
      y2023 <- ymd("2023-01-01") %--% ymd("2024-01-01")
       y2024 <- ymd("2024-01-01") %--% ymd("2025-01-01")
       
       y2023
      @@ -1100,7 +1110,7 @@ 

      days() to find out how many days fit in the year:

      -
      y2023 / days(1)
      +
      y2023 / days(1)
       #> [1] 365
       y2024 / days(1)
       #> [1] 366
      @@ -1120,13 +1130,13 @@