View source: R/utils_colgetters.R
colLevels | R Documentation |
Gives the distinct values of a column of data from the data_frame
colLevels(col, data_frame, rows.use = NULL, used.only = TRUE)
col |
quoted column name. the data column whose potential values should be retrieved. |
data_frame |
A data.frame. |
rows.use |
String vector of rows names OR an integer vector specifying the indices of rows which should be included. Alternatively, a Logical vector, the same length as the number of rows in the data_frame, which indicates which rows to include. |
used.only |
TRUE by default, for target data that are factors, whether levels nonexistent in the target data should be ignored. |
String vector, the distinct values of the col
data column (among the rows.use
targeted rows) of data_frame
.
Daniel Bunis
example("dittoExampleData", echo = FALSE)
colLevels("conditions", example_df)
# Note: Set 'used.only' (default = TRUE) to FALSE to show unused levels
# of data that are already factors. By default, only the used options
# of the data will be given.
colLevels("conditions", example_df,
rows.use = example_df$conditions!="condition1"
)
colLevels("conditions", example_df,
rows.use = example_df$conditions!="condition1",
used.only = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.