select_relevant_rows: Select and return the relevant rows

Description Usage Arguments Value Examples

View source: R/select_relevant_rows.r

Description

This function returns the data frame with the beginning and trailing rows that are all NA removed, it also returns updated first_measurement_index and timestamp variables. The timestamp may advance as a result of the data frame starting with three or more NA's.

Usage

1

Arguments

data

a data frame

timestamp

the date of the first measurement in the format 'yyyy-mm-dd'

net_cfg

a net_cfg object providing metadata about the networks

Value

This function returns a list with three elements, data is the modified data frame, first_measurement_index is the possibly adjusted first_measurement index, and timestamp is the possibly updated timestamp (day).

Examples

1
2
3
4
5
data <- data.frame(id=c(NA,NA,NA,1,1,NA),tijdstip=c(NA,NA,NA,3,4,NA),something=c(NA,NA,NA,9,16,NA))
data
net_cfg <- new_net_cfg()
net_cfg$measurements_per_day <- 2
select_relevant_rows(data,'2014-05-06',net_cfg)

roqua/autovar documentation built on July 25, 2018, 11:30 p.m.