Description Usage Arguments Value See Also Examples
This function extracts variables of specific types from a given dataset. Variables that are either numeric, factor or character are extracted. Furthermore, all variables except the specified type can be extracted also. The results are outputed as a data frame. These results can be saved to a specified directory as a .csv file.
1 2 |
dataset |
A dataset from which the categorical variables are extracted |
type |
The type of data type to be extracted from the dataset. One of three; "numeric", "factor", "character" Default is "numeric" |
extract_not |
A logical object indicting whether all but the specified data type should be extracted. Default is FALSE. |
file_name |
A character object indicating the file name when saving the data frame. The default is NULL. The name must include the .csv suffixs. |
directory |
A character object specifying the directory where the data frame is to be saved as a .csv file. |
Outputs the categorical variables as a data frame.
remove_variables
, derive_variables
, impute_variables
, standardise_variables
, transform_variables
1 2 3 4 5 6 7 8 9 10 | # Example - titanic
# Extract the Numeric Variables
extract_variables(dataset = titanic, type = "numeric")
# Extract the Factor Variables
extract_variables(dataset = titanic, type = "factor")
Extract all but the Character Variables
extract_variables(dataset = titanic, type = "character", extract_not = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.