I have a number of txt files, while each txt file has the same dimension and column names. There are more than 10 years of consecutive daily data in each txt file, and I want to calculate average daily data from the 10 years. If there is a leap year, It will ignore the February 29's value and just use the other 365 days.
I want to put the average daily values (365 values) from the many txt files in a dataframe. Here is a small example txt files.
library(lubridate)
samp1 = data.frame(
time= seq(as.Date('2008-01-01'),as.Date('2010-12-31'),by='day'),
value= rnorm(1096) )
samp1$year = year(samp1$time);samp1$month=month(samp1$time);samp1$day=day(samp1$time)
My question is, how to remove rows if the row has month==2 and day ==29 at the same time? Thanks.