Closed richelbilderbeek closed 8 years ago
Adapted from the documentation:
library(tidyr)
library(dplyr)
df <- data_frame(
xs = c(0.0, 1.0),
ys = c(0.2, 0.8)
)
df %>% expand(xs = seq(0.0, 1.0, 0.2), ys)
Results in:
xs ys
(dbl) (dbl)
1 0.0 0.2
2 0.0 0.8
3 0.2 0.2
4 0.2 0.8
5 0.4 0.2
6 0.4 0.8
7 0.6 0.2
8 0.6 0.8
9 0.8 0.2
10 0.8 0.8
11 1.0 0.2
12 1.0 0.8
Conclusion: expand does repetition, instead of interpolation, and is thus unsuitable for this purpose.
This issue was moved to richelbilderbeek/nLTT#4
To replace
nLTT::get_stretch_matrix