To expand the MrFlick example a bit , suppose you have several instructions stored as strings, as well as the corresponding names that you want to give to the resulting calculations:
ln <- list( "test2", "test3" ) lf <- list( "substr(test, 1, 5)", "substr(test, 5, 5)" )
Match the names with their instructions and convert everything to quosures:
ll <- setNames( lf, ln ) %>% lapply( rlang::parse_quosure )
According to aosmith's suggestion , the entire list can now be passed to mutate using a special operator !!! :
tibble( test = " test@test " ) %>% mutate( !!! ll ) # # A tibble: 1 x 3 # test test2 test3 # <chr> <chr> <chr> # 1 test@test test@ @
source share