Fixes digits option for EDA table.

This commit is contained in:
Garrett 2016-05-27 10:18:07 -04:00
parent 47513d3dd7
commit c66de8e375
1 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,10 @@ The rest of this chapter will look at these two questions. I'll explain what var
**Variation** is the tendency of the values of a variable to change from measurement to measurement. You can see variation easily in real life; if you measure any continuous variable twice---and precisely enough, you will get two different results. This is true even if you measure quantities that should be constant, like the speed of light (below). Each of your measurements will include a small amount of error that varies from measurement to measurement.
```{r include = FALSE}
options(digits = 7)
```
```{r, variation, echo = FALSE}
mat <- as.data.frame(matrix(morley$Speed + 299000, ncol = 10))
@ -59,6 +63,10 @@ mat <- as.data.frame(matrix(morley$Speed + 299000, ncol = 10))
knitr::kable(mat, caption = "*The speed of light is a universal constant, but variation due to measurement error obscures its value. In 1879, Albert Michelson measured the speed of light 100 times and observed 30 different values (in km/sec).*", col.names = rep("", ncol(mat)))
```
```{r include = FALSE}
options(digits = 3)
```
Discrete and categorical variables can also vary if you measure across different subjects (e.g. the eye colors of different people), or different times (e.g. the energy levels of an electron at different moments).
Every variable has its own pattern of variation, which can reveal interesting information. The best way to understand that pattern is to visualize the distribution of the values that you observe for the variable.