r - Select (dplyr) operator with '-' -


how use select (dplyr library) operator name containing '-'? example:

adultuci %>% select(capital-gain)  

caused:

error

try this

data.frame(`a-b` = 1, c = 2, check.names = false) %>%    select(`a-b`) #   a-b # 1   1 

Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -