Here is an approach using base R tools (not tested, so I hope I don't
embarrass myself!)
dayid <- format(data$TimeStamp, '%Y-%m-%d')
day.counts <- table(dayid)
good.days <- names(day.counts)[day.counts == 48]
subset(data, dayid %in% good.days)
This could be written in a one-liner, but it's much e
3
#or
library(plyr)
df3<-df1[ddply(df1,.(as.Date(datetime)),mutate,Ldt=length(datetime)==48)$Ldt,]
identical(df3,df2)
#[1] TRUE
A.K.
- Original Message -
From: "aj...@bath.ac.uk"
To: r-help@r-project.org
Cc:
Sent: Friday, October 4, 2013 11:03 AM
Subject: [R] Subsettin
Hi,
I have a data frame, data, containing two columns: one- the TimeStamp
(formatted using data$TimeStamp <-
as.POSTIXct(as.character(data$TimeStamp), format = "%d/%m/%Y %H:%M") )
and two- the data value.
The data frame has been read from a .csv file and should contain 48
values for ea
3 matches
Mail list logo