I have a dataframe (called TLSWL
) of roughly 20,000 rows. I have a column for Time
in the df and I need to delete all the rows that end in certain minutes. I need to have only the 30 minute increments of time to match other data for comparison.
This is what I'm currently using:
TLSWL<- TLSWL[TLSWL$Time != "0:06"&TLSWL$Time !="0:12"&TLSWL$Time
!="0:18"&TLSWL$Time !="0:24"&TLSWL$Time != "0:36"&TLSWL$Time
!="0:42"&TLSWL$Time !="0:48"&TLSWL$Time != "0:54"&TLSWL$Time
!= "1:06"&TLSWL$Time != "1:12"&TLSWL$Time != "1:18"&TLSWL$Time
!= "1:24"&TLSWL$Time != "1:36"&TLSWL$Time != "1:42"&TLSWL$Time
!= "1:48"&TLSWL$Time != "1:54"&TLSWL$Time != "2:06"&TLSWL$Time
!= "2:12"&TLSWL$Time != "2:18"&TLSWL$Time != "2:24"&TLSWL$Time
!= "2:36"&TLSWL$Time != "2:42"&TLSWL$Time != "2:48"&TLSWL$Time
!= "2:54"&TLSWL$Time != "3:06"&TLSWL$Time != "3:12"&TLSWL$Time
and so on all the way to the times in 24:xx
It works for dataframes that are smaller and not in military time, but as you can see the line of code required by doing it this way ends up being WAY too long.
Can this be done more efficiently?