Description Usage Arguments Details Value Author(s) Examples
View source: R/updateOutputRange.R
remove last row, if its timestep does not match (second - first row)
1 | removeLastIncompleteRecord(data, colTimestamp = "timestamp")
|
data |
the data.frame to check |
colTimestamp |
scalar sting column name holding the time steps |
Expects the timestamp column to hold end-of period timestamps with no missings. If the timestep is smaller than the first, this indicates that the data of the last time step was not complete yet. This method checks on this condition and removes an incomplete last row.
data
with last row removed, if the time step is incomplete
Thomas Wutzler
1 2 3 4 5 6 7 | nRec <- 10
dsComplete <- data.frame(date = seq(
ISOdatetime(2010,1,1,0,0,30, tz = "UTC"), by = "30 min", length.out = nRec))
dsIncomplete <- dsComplete
dsIncomplete$date[nRec] <- dsIncomplete$date[nRec] - 2*60
nrow( removeLastIncompleteRecord(dsComplete, "date") )
nrow( removeLastIncompleteRecord(dsIncomplete, "date") )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.