fix.data | R Documentation |
Fixes any input data to prepare them to export to ARFF/ADX formats. If after exporting data to ARFF/ADX formats there are some problems in running Java MCFS or WEKA, try to use this function before. This function fixes data values (e.g. space " " is replaced by "_") and data types (e.g. all Date columns converted to character in R).
fix.data(x,
type = c("all", "names", "values", "types"),
source_chars = c(" ", "'", ",", "/", "|", "#",
"-", "(", ")", "[", "]", "{", "}"),
destination_char = "_",
numeric_class = c("difftime"),
nominal_class = c("factor", "logical", "Date", "POSIXct", "POSIXt"))
x |
input data frame to be fixed. |
type |
|
source_chars |
characters that will be replaced in column names and data values. |
destination_char |
character that will be inserted in column names and data values. |
numeric_class |
vector of class labels to be casted |
nominal_class |
vector of class labels to be casted |
data.frame with fixed values and types (depends on type
parameter).
## Not run: ###dontrunbegin
# create artificial data
adata <- artificial.data(rnd_features = 1000)
# Fix data types and data values - remove "," " " "/" from values and fix data types
# This function may help if mcfs has any problems with input data
adata.fixed <- fix.data(adata)
## End(Not run)###dontrunend
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.