Need help filtering out a specific piece of data

I am working on a capstone project for my course and there is a column for rideable type. That column has three different types: docked_bike, electric_bike, and classic_bike. I am trying to look at the data for just docked_bike but cannot seem to figure out how I did it before. Can someone help me?

your_data$docked_bike

The column itself is called rideable_type, not docked_bike. The column has three different types: docked_bike, electric_bike, and classic_bike.

Is this familiar? It uses the filter() function from the dplyr package. Make sure you load dplyr (or tidyverse, which will also load dplyr) to override the filter() function in base R.

filter(your_data, rideable_type == "docked_bike")

or using the pipe operator

your_data %>% filter(rideable_type == "docked_bike")

1 Like

To avoid this kind of misunderstanding, next time please provide a proper REPRoducible EXample (reprex) illustrating your issue.

Thank you, this worked! I tried this but was adding select() for some reason.

This topic was automatically closed 7 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.