PTprocstring {pinktoe} | R Documentation |
Splits information (which can be obtained indirectly from path.rpart) in R comes in phrases like "Country=abc" (for factor variables) or "Weight<=6" (for numeric variables) needs to be converted into the format ":abc" and "<=6" to match the S-like format.
PTprocstring(s, vtype)
s |
Splits information string from rpart (via path.rpart) |
vtype |
Whether the variable is "factor" or not |
If vtype
is not a factor then the string is treated as if
it were numeric.
A splits string but in S format.
Not intended for general use
Guy P Nason
# # Process string "Country=abc" for factor variable # PTprocstring("Country=abc", "factor") # # [1] ":abc" # # Process string "Weight<=6" for numeric variable # PTprocstring("Weight<=6", vtype="numeric") # # [1] "<=6" #