Adds a residual error term (column .error) to the data frame, drawn from a normal distribution with specified variance.
Examples
df <- tibble::tibble(x = 1:5)
add_error(df, variance = 2)
#> # A tibble: 5 × 2
#> x .error
#> <int> <dbl>
#> 1 1 0.695
#> 2 2 -1.07
#> 3 3 0.494
#> 4 4 -0.242
#> 5 5 2.31