Description Usage Arguments Details Value Functions See Also Examples
View source: R/coo_modifyers.R
Changes the number of shape coordinates.
1 2 3 4 5 | coo_sample(x, n, from_col, to_col, ...)
coo_sample_prop(x, prop, from_col = coo, to_col = coo, ...)
coo_interpolate(x, n, from_col, to_col, ...)
|
x |
coo_single, coo_list or mom_tbl |
n |
|
from_col |
colnames from where to get the coo_list and how to name the resulting one (only for mom_tbl method) |
to_col |
colnames from where to get the coo_list and how to name the resulting one (only for mom_tbl method) |
... |
useless here |
prop |
|
coo_sample will return coordinates regularly sampled along the curvilinear abscissa.
The last point will be dropped so that the distance (new last - first) roughly equals
all other distances between consecutive points. This is typically useful for outlines.
coo_sample_curve (todo link) will preserve the first and last points.
This is typically useful for curves, hence the name.
coo_interpolate will upsample the number of points.
All functions have a _prop ally, where n is deduced from the proportion you want to retain.
a coo_single, coo_list or mom_tbl
coo_sample_prop: Sample a proportion of coordinates
coo_interpolate: Interpolates shape coordinates
Other coo_modifyers:
coo_align(),
coo_baseline(),
coo_center(),
coo_reflect,
coo_rev(),
coo_rotatecenter(),
coo_rotate(),
coo_sample_rr(),
coo_scale(),
coo_shear(),
coo_slide(),
coo_split(),
coo_template(),
coo_trans(),
coo_trim(),
coo_up()
1 2 3 4 5 6 | x <- bot %>% pick(1) %>% coo_sample(24)
x %>% gg()
x %>% coo_interpolate(120) %>% gg()
bot$coo[1:2] %>% coo_sample(12) %>% purrr::map_dbl(nrow)
bot$coo[1:2] %>% coo_sample(12) %>% coo_interpolate(24) %>% purrr::map_dbl(nrow)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.