Feature?: Convert Text to Factor/Integer
Posted: Tue Feb 19, 2019 10:25 pm
Use case:
- Ordinal data as text in Excel/csv (e.g., "Strongly Agree", "Agree", etc).
- Imported into Jamovi as Text
- Want to calculate mean (or do other numeric things like "greater than" to get all Agree's)
The only way I can think of is to use Transform to create an integer variable. But, the new variable is treated as Nominal (since the original was) so it cannot immediately be treated as a number. Plus, a transformed variables cannot have labels, so one must keep both variables or copy and paste the transformed values into yet another variable, label it, and remove the two originals.
Am I missing a easier way?
If not, could there be a button to convert a text variable into a numeric variable? People could also use it to "re-level" an existing factor. Or, maybe factor it automatically if someone tries changing the data type from text to an integer., Or, have an option for (or default to) "stringsAsFactors" on import (I know some people dislike that, but it has uses).
- Ordinal data as text in Excel/csv (e.g., "Strongly Agree", "Agree", etc).
- Imported into Jamovi as Text
- Want to calculate mean (or do other numeric things like "greater than" to get all Agree's)
The only way I can think of is to use Transform to create an integer variable. But, the new variable is treated as Nominal (since the original was) so it cannot immediately be treated as a number. Plus, a transformed variables cannot have labels, so one must keep both variables or copy and paste the transformed values into yet another variable, label it, and remove the two originals.
Am I missing a easier way?
If not, could there be a button to convert a text variable into a numeric variable? People could also use it to "re-level" an existing factor. Or, maybe factor it automatically if someone tries changing the data type from text to an integer., Or, have an option for (or default to) "stringsAsFactors" on import (I know some people dislike that, but it has uses).