Selecting Specific Rows with Date and Time values in Rstudio
0
0
Entering edit mode
4.2 years ago

In order to investigate the seasonality effect in my data set, I want to select rows with a specific date and time values. I have multiple rows with the same date and time value ( i have combined multiple CSV files, each starting from the first day of January to the last day of December). I am using the following code;

filter(data,data$DateTime > "2019-01-01" & data$DateTime < "2019-03-01" )

but the results are not what I want. How can I select my desired range of date and time and save it in a distinct data frame to perform my analysis on it?

Thank you

R • 1.8k views
ADD COMMENT
1
Entering edit mode

Check the attached thread in StackOverflow https://stackoverflow.com/questions/22420487/subsetting-data-table-set-by-date-range-in-r

  • Convert the type of date column to Date.
ADD REPLY
0
Entering edit mode

Now it just returns NA values!

ADD REPLY
0
Entering edit mode

Share an excerpt of the data.

ADD REPLY

Login before adding your answer.

Traffic: 2508 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6