View source: R/prep_data_dumbbell.R
prep_data_dumbbell | R Documentation |
mk_dumbbell
. Not for external use.prep_data_dumbbell
takes in the original data frame, the
left and right end point x variables, the y variable, and the
instruction on how to order the y levels. It returns a data frame with y
ordered according to the supplied instruction, and a new column called
diff (difference between the right and left end point xvars) appended.
prep_data_dumbbell(df, xvar_left, xvar_right, yvar, yorder)
df |
Data frame of the original data. |
xvar_left |
String, name of a numeric variable, left end-point on x. |
xvar_right |
String, name of a numeric variable, right end-point on x. |
yvar |
String, name of y categorical (character or factor) variable. |
yorder |
String, possible values are "alphanumeric", "descend" or "ascend". If "alphanumeric", order y levels in alphanumerical order along y-axis. If "ascend"/"descend", order y levels in ascending/descending order of the difference between xvar_right and xvar_left. |
The original data frame with y ordered according to instruction and a new column called diff appended.
mk_dumbbell
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.