Description Usage Arguments Details Value Examples
A dual score matrix function that allows for multiple performance, and cross variables.
1 2 |
formula |
A formula of the form LHS ~ RHS to use to specify which fields to use as the scores and performance measures in the tables, see Details. |
data |
A data.frame, that has the fields specified in the formula. |
cut_method |
The method to use to format the score in the final table. The method may be a single charcter specifying the cut method, or a list with two elements, specifing the method for the left, and right side of the formula respectively. Currently the available methods are:
|
method_args |
Arguments to use for the method specified in
|
exceptions |
A vector of exception values to exclude from the cross table.
The default is set to |
custom_cut_fnc |
A custom function to use to cut the scores. |
... |
Other arguments to pass to the |
Formula...
The formula interface of scorex provides an API for intuatively creating dual score matrices. The formula takes the following form:
LHS ~ RHS | extra vars
Each portion of the formula allows for the following funtionality.
This portion of the formula can be used to identify one or several
score like variables, each seperated with a +
, that will be displayed along
the right most column of the scorex table.
This portion of the formula can be used to identify one or several
score like variables, each seperated with a +
, that will be displayed along
the first row of the scorex table.
Optional variables to distribute along the score variables.
By default these variables will be treated as binary performance fields, and the
rate and total will be displayed. A !
symbol (exclaimation mark) may be
used to signify that the variable should be treated like a continuous numeric field
such as a dollar value.
If more than one variable is placed in the 'LHS' or 'RHS' of the formula dual score tables will be created of all possible combinations of the cross variables.
An object of class scorex
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Formula Examples
mc_tabs <- scorex(disp ~ hp, data = mtcars)
mc_tabs$tables
mc_tabs <- scorex(disp ~ hp | vs, data = mtcars)
mc_tabs$tables
mc_tabs <- scorex(disp ~ hp + mpg | vs, data = mtcars)
mc_tabs$tables
mc_tabs <- scorex(disp ~ hp + mpg | vs + !wt, data = mtcars)
mc_tabs$tables
# Examples of cut method
mc_tabs <- scorex(disp ~ hp | vs, data = mtcars,
cut_method = "bins", method_args = 4)
mc_tabs$tables
mc_tabs <- scorex(disp ~ hp | vs, data = mtcars,
cut_method = list("bins", "percentiles"),
method_args = list(2, c(1, 25, 75, 100)))
mc_tabs$tables
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.