search for: dayindex1

Displaying 1 result from an estimated 1 matches for "dayindex1".

Did you mean: dayindex2
2013 Jan 12
1
How to extract value for specific rows in an array?
...days<- nrow(DF)/samplesperday # number of days in the dataset (5 here) MaxDepth <- array(NaN,c(nbdays,1)) # create empty array where max depth values will be stored Date <- array(NaN,c(nbdays,1)) # create empty array where date for max depth values will be stored for (i in 1:nbdays){ dayIndex1 <- samplesperday*(i-1)+1 # start of day period (value 1 of 2880) dayIndex2 <- samplesperday*(i) # end of day period (value 2880 of 2880) MaxDepth[i] <- max(DF$depth[dayIndex1:dayIndex2]) # extract max depth value from the 2880 datapoints collected per day Date [i] <- DF$date[...