Filtered data function attempted to remove some rows off uploaded Excel spreadsheet

re: Posit Cloud

Hello, I've uploaded an Excel spreadsheet with over 800,000 rows which, while it was in Excel, I was able to quickly create a new column to populate with "dates are equal" or "dates are not equal" in regards to two other columns with dates. Most of those dates are the same, but about 5,000 aren't and those are the ones denoted in the new column with "dates are not equal". When I try to remove the entire row of each of those 5,000, it takes too long, so I uploaded this spreadsheet to RStudio to use the read, filter, and write functions to return the document with those 5,000 rows removed. I installed and loaded the readxl() and writexl() functions. The column I created is named dates_temp. Looking at the code attempts, can you tell what function I should be using or if I'm writing this code incorrectly? Here's the coding and error messages if you don't see the URL above:

data <- read_excel("cyclistic_july_2022_dates.xlsx")
New names:
• `` -> ...3
started_at -> started_at...4
started_at -> started_at...5
ended_at -> ended_at...6
ended_at -> ended_at...8
filtered_data <- data %>% filter(dates_temp == "dates are not equal")
Error in data %>% filter(dates_temp == "dates are not equal") :
could not find function "%>%"
filtered_data <- data(dates_temp == "dates are not equal")
Warning message:
In data(dates_temp == "dates are not equal") :
data set ‘dates_temp == "dates are not equal"’ not found
filtered_data <- filter(dates_temp == "dates are not equal")
Error: object 'dates_temp' not found

You either need library(magrittr) or to switch to the newer built-in pipe |>.

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.