r4ds/transform.Rmd

29 lines
786 B
Plaintext

---
layout: default
title: Data transformation
output: bookdown::html_chapter
---
# Data transformation
## Missing values
* Why `NA == NA` is not `TRUE`
* Why default is `na.rm = FALSE`.
## Data types
Overview of different data types and useful summary functions for working with them. Strings and dates covered in more detail in future chapters.
Need to mention `typeof()` vs. `class()` mostly in context of how date/times and factors are built on top of simpler structures.
### Logical
When used with numeric functions, `TRUE` is converted to 1 and `FALSE` to 0. This makes `sum()` and `mean()` particularly useful: `sum(x)` gives the number of `TRUE`s in `x`, and `mean(x)` gives the proportion.
### Numeric (integer and double)
### Strings (and factors)
### Date/times