Hello, I am using the begin_date and end_date functions to filter my data but eventually they delete all the rows. I have tried to make sure that the end_date
I specify is earlier than the earliest date in your dataset but this does not seem to help. Would anyone know what I can do to apply this subsets?
Below are the functions I am using:
begin_date <- as.Date("2022-01-01 UTC")
end_date <- as.Date("2023-01-31 UTC")
library(dplyr)
library(tidyr)
data <- read_excel("Data.xlsx", sheet = "data")
data2 <- data %>%
subset(`date` >= begin_date & `date` <= end_date)
Note these are the results I get when I check my min and max dates:
min(data$date)
[1] "2022-02-16 UTC"
max(data$date)
[1] "2023-02-21 UTC"