Learn R Programming

ganalytics (version 0.10.7)

SortBy: SortBy

Description

Get the sortBy order of the query.

Set the order of rows returned by Google Analytics.

Usage

SortBy(object, ..., desc = logical(0), type = c("VALUE", "DELTA",
  "SMART", "HISTOGRAM_BUCKET", "DIMENSION_AS_INTEGER")[0L])

SortBy(object) <- value

# S4 method for .varList SortBy(object, desc, type)

# S4 method for `NULL` SortBy(object)

# S4 method for character SortBy(object, ..., desc = logical(0), type = c("VALUE", "DELTA", "SMART", "HISTOGRAM_BUCKET", "DIMENSION_AS_INTEGER")[0L])

# S4 method for .query SortBy(object, value)

# S4 method for .query SortBy(object) <- value

Arguments

object

A character vector or list of dimensions or metrics to sort by. If character, then prefixing the dimension name with a "+" means ascending order or "-" for descending order. By default metrics are sorted in descending order, while dimensions are by default in ascending order. Alternatively, supply a query object and replacement dimensions and metrics or sort by.

...

Further dimensions or metrics to sort by, or if object is a query then the replacement list of dimensions or metrics to sort by.

desc

A logical vector, same length as the resulting list of dimension or metric variables, indicating which columns of the resulting query response should be sorted in descending order.

type

A character vector, same length as the vector of variables to sort by, indicating the method of sorting to be applied to each variable. Available sort types are "VALUE", "DELTA", "SMART", "HISTOGRAM_BUCKET" or "DIMENSION_AS_INTEGER".

value

The replacement dimensions and metrics for the supplied object.

Methods (by class)

  • .varList: Coerce a .varList object to a .sortBy child-class.

  • NULL: Returns NULL

  • character: Return a sortBy object given by the variables named within a character vector, optionally denoted with - or + to indicate descending or ascending sorting for each variable respectively in order of precedence.

  • .query: Replace the sort by argument of a query.

  • .query: Replace the sort by argument of a query.

See Also

Other query object functions: Dimensions, MaxResults, Metrics, SamplingLevel, TableFilter

Other query object functions: Dimensions, MaxResults, Metrics, SamplingLevel, TableFilter