getAnametrixDataset: getAnametrixDataset

Description Usage Arguments Details Value See Also

Description

Extracts data from Anametrix API into an R data frame

Usage

1
2
3
4
5
6
getAnametrixDataset(table.object, segment.id = NULL, columns = NULL,
  filter.def = list(column = NULL, type = c("equals", "in this list"), value =
  NULL), start.date, end.date, max.rows = 1e+08, unit.of.time = "day",
  sort.column = NULL, sort.direction = "asc", verbose = TRUE,
  date.format.override = FALSE, return.as.date.selection = FALSE,
  use.binary.func = TRUE)

Arguments

table.object

Configuration of a table. Use getTableConfiguration to get it

segment.id

segment id to apply (see getSegmentInfo). NULL is no segment is wanted.

columns

Array of column names for the request. Example: c("city","country","male_population") Use printTable(tableObject) to see all column names (internal names are used) or the field $ColumnNames of the output of getTableConfiguration If columns is an empty vector, all the columns of the table will be downloaded.

filter.def

equal or in this list filter. Needs to be of the form filter.def = list(column=NULL, type=c("equals", "in this list"), value=NULL)

start.date

Start date of the request. Use YYYY-MM-DD format. Example: "2015-01-01"

end.date

End date of the request. Use YYYY-MM-DD format. Example: "2016-01-01"

max.rows

Number of rows requested. Example: 10000

unit.of.time

Format of the date column. Example: "day", "hour", "week", or custom format like "MM-dd-yy" or "w-yyyy"

sort.column

Column to sort on. Use any column provided in the columns array

sort.direction

"desc" or "asc"

verbose

Specifies whether to print out notifications

date.format.override

TRUE or FALSE. Adjusts date formatting

return.as.date.selection

NULL, TRUE or FALSE. Adjusts date formatting

use.binary.func

TRUE or FALSE

Details

if use.binary.func is FALSE, getURL is used to download text to a temporary file that is read in a dataframe if use.binary.func is TRUE, getBinaryURL is used to download binary data. This can be used to avoid error in encoding like embedded null. No temporary file is used.

Value

R data frame containing the number of observations requested from the Anametrix API table

See Also

Other dowload/upload functions: getAxDatasetFromEncodedQuery, getTableConfiguration, uploadData


anametrix documentation built on Jan. 15, 2017, 3:13 p.m.