Description Usage Arguments Value Examples
Compute percentiles including boxplot quartiles across values of column
columnName. Multiple sets of percentiles achieved with the
parameter by. Vector by may contain arbitrary number
of column names: the percentiles are computed for each combination
of values from these columns. Remember that when using computed
quartiles with function createBoxplot it can utilize
up to 3 columns by displaying them along the x-axis and inside
facets.
1 2 3 4 5 |
channel |
connection object as returned by |
tableName |
Aster table name |
columnName |
deprecated. Use vector |
columns |
names of the columns to compute percentiles on |
temporal |
logical: TRUE indicates all columns are temporal, otherwsie numerical.
Temporal percentiles have 2 values: character |
percentiles |
integer vector with percentiles to compute. Values |
by |
for optional grouping by one or more values for faceting or alike.
Used with |
where |
specifies criteria to satisfy by the table rows before applying
computation. The creteria are expressed in the form of SQL predicates (inside
|
nameInDataFrame |
name of the column in returned data frame to store table column name(s)
defined by parameter |
stringsAsFactors |
logical: should columns returned as character and not excluded by |
test |
logical: if TRUE show what would be done, only (similar to parameter |
parallel |
logical: enable parallel calls to Aster database. This option requires parallel
backend enabled and registered (see in examples). Parallel execution requires ODBC |
For numeric data function returns a data frame with percentile values organized into following columns:
percentile percentile to compute (from 0 to 100): will contain all valid values
from percentiles
value computed percentile
column table column name. Override name column with parameter nameInDataFrame
or omit this column all together if NULL.
by[1], by[2], ... in presence of parameter by, contain values of the grouping
columns for computed percentiles (optional).
For temporal data function returns a data frame with percentile values organized into following columns:
percentile percentile to compute (from 0 to 100): will contain all valid values
from percentiles
value computed percentile value converted from temporal data type to its character representation.
epoch corresponding to temporal percentile value epoch: for date and
timestamp values, the number of seconds since 1970-01-01 00:00:00-00 (can be negative);
for interval values include time, the total number of seconds in the interval.
column table column name. Override name column with parameter nameInDataFrame
or omit this column all together if NULL.
by[1], by[2], ... in presence of parameter by, contain values of the grouping
columns for computed percentiles (optional).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | if(interactive()){
# initialize connection to Lahman baseball database in Aster
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")
# ipouts percentiles for pitching ipouts for AL in 2000s
ipop = computePercentiles(conn, "pitching", "ipouts",
where = "lgid = 'AL' and yearid >= 2000")
# ipouts percentiles by league
ipopLg = computePercentiles(conn, "pitching", "ipouts", by="lgid")
# percentiles on temporal columns
playerAllDates = computePercentiles(conn, "master_enh",
columns=c('debut','finalgame','birthdate','deathdate'),
temporal=TRUE, percentiles=c(0))
createBoxplot(playerAllDates, x='column', value='epoch', useIQR=TRUE,
title="Boxplots for Date columns (epoch values)",
legendPosition="none")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.