util_tv: Utility functions for the tv package

Description Usage Details

Description

These utility functions are very specific for the tv rawdata.

Usage

1
2
3
4
5
6
7
id.time()

id.tmb(x)

id.day(day, to, dem.day = NULL)

pin.type(dt)

Details

id.tmb reshapes the timeband object in setup(tmb = list('wholeday' = c(start = '02:00:00', end = '25:59:59'))) (default) into a more compact form for use in overlap.join(). Gives labels for each tmb if not specified in names(tmb). Important: if 'end' is specified like in Instar, than 1 second has to be subtracted to match Instar results! E.g.: if specified in Instar: 08:03:07 - 12:04:25 the equivalent for this tv package is c(start = 08:03:07, end = 12:04:24), that means: end-1

id.day is a function to conveniently create a sequence of Dates. For convenience there are three ways of specifying the days to analyse:

  1. by entering a prespecified vector of dates in 'day'.

  2. by specifying the start end end dates in 'day' and 'to' respectively.

  3. by specifying start date 'day' and the length of the sequence of days in 'nday'. If 'nday' is negative the sequence will be created backwards.

day is a character vector of dates in the form '2015-12-31' Time shifted viewing is limited to 7 days by definition. The demografics file is usually loaded for the live dates but this is allowed to differ: Analysing the viewing of a fixed sample at one day alows to circumvent the fact that otherwise weights change every day. use class Date to correctly creating sequencies of dates but store dates as character, its much easier to program with and more efficient


rluech/tv-clone documentation built on Jan. 7, 2022, 12:27 a.m.