List columns verbs

col_present(x, col)

coo_present(x, coo)

coe_present(x, coe)

coo_nb(x)

coe_nb(x)

coo_only(x)

coe_only(x)

coo_drop(x)

coe_drop(x)

coo_select(x, ...)

coe_select(x, ...)

coo_names(x)

coe_names(x)

Arguments

x

mom_tbl

col

column names to test for existence

coo, coe

column names to test for existence

...

additional parameters, just like in dplyr::select

Functions

  • col_present: test coo columns existence

  • coo_present: test coo columns existence

  • coe_present: test coe columns existence

  • coo_nb: count the number of coo columns

  • coe_nb: count the number of coe columns

  • coo_only: only retain coo columns

  • coe_only: only retain coe columns

  • coo_drop: drop coo columns

  • coe_drop: drop coe columns

  • coo_select: use select among coo columns

  • coe_select: use select among coe columns

  • coo_names: return names of coo columns

  • coe_names: return names of coe columns

Examples

bot %>% coo_nb()
#> [1] 1
bot %>% coo_names()
#> [1] "coo"
bot %>% coo_present(coo)
#> [1] TRUE
bot %>% coo_present(foo) # non existing column
#> [1] FALSE
bot %>% coo_only()
#> # A tibble: 40 x 1 #> coo #> <list<coo_single[,2]>> #> 1 <tibble [138 × 2]> #> 2 <tibble [168 × 2]> #> 3 <tibble [189 × 2]> #> 4 <tibble [129 × 2]> #> 5 <tibble [152 × 2]> #> 6 <tibble [161 × 2]> #> 7 <tibble [124 × 2]> #> 8 <tibble [126 × 2]> #> 9 <tibble [183 × 2]> #> 10 <tibble [193 × 2]> #> # … with 30 more rows #> ❯mom_tbl
bot %>% coo_drop()
#> # A tibble: 40 x 2 #> type fake #> <fct> <fct> #> 1 whisky a #> 2 whisky a #> 3 whisky a #> 4 whisky a #> 5 whisky a #> 6 whisky a #> 7 whisky a #> 8 whisky a #> 9 whisky a #> 10 whisky a #> # … with 30 more rows #> ❯mom_tbl
bot$coo2 <- bot$coo bot %>% coo_select(coo2)
#> # A tibble: 40 x 3 #> coo2 type fake #> <list<coo_single[,2]>> <fct> <fct> #> 1 <tibble [138 × 2]> whisky a #> 2 <tibble [168 × 2]> whisky a #> 3 <tibble [189 × 2]> whisky a #> 4 <tibble [129 × 2]> whisky a #> 5 <tibble [152 × 2]> whisky a #> 6 <tibble [161 × 2]> whisky a #> 7 <tibble [124 × 2]> whisky a #> 8 <tibble [126 × 2]> whisky a #> 9 <tibble [183 × 2]> whisky a #> 10 <tibble [193 × 2]> whisky a #> # … with 30 more rows #> ❯mom_tbl
hearts %>% col_present(ldk)
#> [1] TRUE
# and works the same for coe columns