When reading a dataset with an R recipe, I find myself struggling with types. In this specific case I would like to know how to prevent the DSS from reading my string columns as factors. In R there is an option "stringsAsFactors = F" in the function "data.frame". Is there any equivalent in the DSS?
My column is stored as a string but when using a recipe it is read as a factor. I need to compare the value with a specific string and it cannot be done with factors.
Alternatively, would you be able to suggest any function to convert the type? A naive way to do this would be to use as.character but it doesn't work (the output is a number, not my word as a string).
The trick might be to apply as.character on individual columns, not on the dataframe. Does this page answer your question? http://stackoverflow.com/questions/19204729/how-to-change-factor-labels-into-string-in-a-data-frame
Thank you for you reply but I am afraid that it doesn't. My question wasn't clear, allow me to rephrase it.
I am actually trying to applying as.character() on an individual column. Here is an example (I cannot share the actual data) of the vector Z: Aaaa Bbbb Cccc So indeed I can use as.character(Z) but it doesn't always work for some reason. (number output instead of "Aaaa", "Bbbb", "Cccc").
The point of my question was to point out that it'd be probably more efficient to use an option similar to stringsAsFactors = F when reading the whole dataset. This page points out the difference: http://stackoverflow.com/questions/2851015/convert-data-frame-columns-from-factors-to-characters