GeoTimeseries: Constructs a 'GeoTimeseries' object.

Description Usage Arguments Value

View source: R/geotimeseries.R

Description

Constructs a GeoTimeseries object.

Usage

1
GeoTimeseries(x, metrics = character(0), date.format = "%Y-%m-%d")

Arguments

x

a plain data.frame or an object that has to be coercible to a plain data.frame with columns date, geo. date must be a Date object or a character vector or factor coercible to Date, and 'geo' must be a character vector, factor, or integer-valued. All columns that start with a dot (.) are removed. If geo is an integer-valued numeric or factor, it is coerced to character silently without error. If date is a character or factor, it is silently coerced to Date. An error is output if the date conversion fails.

metrics

(character) column names that point to numeric columns. At least one metric must be specified. All metrics have to be not all NA.

date.format

(string, optional) format of the column date in the form understood by as.Date(). Used only if the date column is of character type.

Value

A GeoTimeseries object, which is a data.frame, with the required columns,

These should be convenient for generating totals and averages, using the aggregate method. The columns 'date' and 'geo' form the primary keys: it is guaranteed that no duplicate ('date', 'geo') pairs exist.

The object includes fields stored in the attribute 'info':


google/GeoexperimentsResearch documentation built on May 17, 2019, 7:42 a.m.