Error in UseMethod("select_") : no applicable method for 'select_' applied to an object of class "c('integer', 'numeric')" in r?

Viewed 1665

I am trying to create a dataset out of this data:

enter image description here

I want to include the Asian, African American, Other, White and Hispanic Counts. In order to do this, I have tried the code:

library(dplyr)
race_mut <- race %>%
  filter(!is.na(race))
  select(race$African_American, race$White, race$Hispanic, race$Asian, race$Other)

race_mut

But I keep getting this error:

Error in UseMethod("select_") : no applicable method for 'select_' applied to an object of class "c('integer', 'numeric')"

How do I fix this?

0 Answers
Related