Fix typos (#158)
This commit is contained in:
parent
04093294b1
commit
52c609eaad
10
vectors.Rmd
10
vectors.Rmd
|
@ -181,11 +181,11 @@ Now that you understand the different types of atomic vector, it's useful to rev
|
|||
|
||||
There are two ways to convert, or coerce, one type of vector to another:
|
||||
|
||||
1. Explicit coercion happesn when you call a function like `as.logical()`,
|
||||
1. Explicit coercion happens when you call a function like `as.logical()`,
|
||||
`as.integer()`, `as.double()`, or `as.character()`. Whenever you find
|
||||
yourself using explicit coercion, you should always check whether you can
|
||||
make the fix upstream, so that the vector never had the wrong type in
|
||||
the first place. For example, you may need to tweak you readr
|
||||
the first place. For example, you may need to tweak your readr
|
||||
`col_types` specification.
|
||||
|
||||
1. Implicit coercion happens when you use a vector in a specific context
|
||||
|
@ -516,7 +516,7 @@ knitr::include_graphics("images/pepper-3.jpg")
|
|||
1. Draw the following lists as nested sets:
|
||||
|
||||
1. `list(a, b, list(c, d), list(e, f))`
|
||||
1 `list(list(list(list(list(list(a))))))`
|
||||
1. `list(list(list(list(list(list(a))))))`
|
||||
|
||||
1. What happens if you subset a data frame as if you're subsetting a list?
|
||||
What are the key differences between a list and a data frame?
|
||||
|
@ -539,7 +539,7 @@ There are three very important attributes that are used to implement fundamental
|
|||
|
||||
* "names" are used to name the elements of a vector.
|
||||
* "dims" make a vector behave like a matrix or array.
|
||||
* "class" is used to implemenet the S3 object oriented system.
|
||||
* "class" is used to implement the S3 object oriented system.
|
||||
|
||||
### S3
|
||||
|
||||
|
@ -627,7 +627,7 @@ typeof(y)
|
|||
attributes(y)
|
||||
```
|
||||
|
||||
If you use the packages outlined in this book, you should never encounter a POSIXlt. They do crop up in base R, because they are used extract specific components of a date (like the year or month). However, lubridate provides helpers for you to do this instead. Otherwise POSIXct's are always easier to work with, so if you find you have a POSIXlt, you should always convert it to a POSIXct with `as.POSIXct()`.
|
||||
If you use the packages outlined in this book, you should never encounter a POSIXlt. They do crop up in base R, because they are used to extract specific components of a date (like the year or month). However, lubridate provides helpers for you to do this instead. Otherwise POSIXct's are always easier to work with, so if you find you have a POSIXlt, you should always convert it to a POSIXct with `as.POSIXct()`.
|
||||
|
||||
### Data frames and tibbles
|
||||
|
||||
|
|
Loading…
Reference in New Issue