Select a subset of items from a yspec object

ys_select(.x, ...)

Arguments

.x

A yspec object.

...

Unquoted columns to select.

Value

A yspec object that may be length zero if no columns were selected.

Details

If no columns are selected, then an empty yspec object is returned.

Examples


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