Removing Values from a Data Frame

Dear All,

I wondered if anyone could help me understand how to remove values from a data frame in R?

Suppose for example my data frame had 8 variables.

  1. MR (a categorical variable)
  2. Mob (a categorical variable)
  3. SC (a categorical variable)
  4. Act (a categorical variable)
  5. Pain (a categorical variable)
  6. Anx (a categorical variable)
  7. Score (continuous variable)
  8. Age (continuous variable)

Suppose now that with the categorical variables, I only cared about values between 0 and 3, yet my data frame included values greater than 3.

Would anybody be able to tell me how I can delete values greater than 3?

Would be appreciated.

One option is to use dplyr::filter() function.

Also, you can learn more about data wrangling from this free ebook

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.