Select a subset of items from a yspec object
ys_select(.x, ...)
A yspec
object that may be length zero if no columns were selected.
If no columns are selected, then an empty yspec
object is returned.
spec <- ys_help$spec()
ys_select(spec, WT, AGE, ALB)
#> name info unit short source
#> WT --- kg weight ysdb_internal
#> AGE --- years age ysdb_internal
#> ALB --- g/dL albumin ysdb_internal
ys_select(spec, Wt = WT, AGE)
#> name info unit short source
#> Wt --- kg weight ysdb_internal
#> AGE --- years age ysdb_internal
length(ys_select(spec))
#> [1] 0