diff --git a/datetimes.Rmd b/datetimes.Rmd index 65ca13d..2538375 100644 --- a/datetimes.Rmd +++ b/datetimes.Rmd @@ -4,7 +4,7 @@ This chapter will show you how to work with dates and times in R. Dates and time This chapter will focus on R's __lubridate__ package, which makes it much easier to work with dates and times in R. You'll learn the basic date time structures in R and the lubridate functions that make working with them easy. We will also rely on some of the packages that you already know how to use, so load this entire set of packages to begin: -```{r messages = FALSE, warnings = FALSE} +```{r message = FALSE, warning = FALSE} library(nycflights13) library(dplyr) library(stringr) @@ -14,7 +14,7 @@ library(lubridate) ## Parsing times -Time data normally comes as character strings, or numbers spread across columns, as in the `flights` data set from Chapter ?. +Time data normally comes as character strings, or numbers spread across columns, as in the `flights` data set from [Relational data]. ```{r} flights %>% @@ -114,7 +114,6 @@ zero_day - 1 R can also save datetimes in the POSIXlt form, a list based date structure. Working with POSIXlt dates can be much slower than working with POSIXct dates, and I don't recommend it. Lubridate's parse functions will always return a POSIXct date when you supply an hour, minutes, or seconds component. - ## Arithmetic with dates Did you see how I calculated the scheduled departure and arrival times for our flights? I added the appropriate number of seconds to the actual departure and arrival times. You can take this approach even farther by adding hours, days, weeks, and more. @@ -384,7 +383,7 @@ datetimes %>% geom_bar(stat = "identity") ``` -You cn also use the `yday()` accessor to see that average delays fluctuate throughout the year. +You can also use the `yday()` accessor to see that average delays fluctuate throughout the year. ```{r fig.height=3, warning = FALSE} datetimes %>% @@ -397,7 +396,6 @@ datetimes %>% ``` - ### Setting dates You can also use each accessor funtion to set the components of a date or datetime. diff --git a/relational-data.Rmd b/relational-data.Rmd index c7910d2..7c43da7 100644 --- a/relational-data.Rmd +++ b/relational-data.Rmd @@ -1,4 +1,4 @@ -# Relational data {#relation-data} +# Relational data ```{r setup-relation, include = FALSE} library(dplyr)