on 11-22-2013 2:15 PM
Hello everybody,
is there an easy way within PA to force R to interpret a 4 digit number as a string instead of a number?
Background: When I select a numerical column as item for the R-Apriori-Algorithm following error occurs:
java.lang.Throwable: An error occurred while
executing commands in the R environment. Error from R: "Error in
asMethod(object) : column(s) 3 not logical or a factor. Use as.factor or
categorize first. "
This happens always if the regarding column contains only digits and no characters, independently of whether I configured PA to interpret the column as an integer or as a string.
Thanks for help.
Hi Jan,
you can try putting a 'data type definition' component in front of the apriori. This allows you to ensure the data type is string.
Greetings
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas,
thanks for your quick response.
Unfortunately putting a 'data type definition' in front of Apriori to change the column's type to string does not help. Still the same error message.
I tested a lot today and it feels like R is always interpreting a column that only contains digits as an integer automatically, independent of the data type definition.
Regards,
Patrick
Hi Andreas,
yes, I'm on Version 1.0.11.
Your workaround is working when I use the CONCAT-Formula to append a character to the number.
I tried several String Functions but only the CONCAT is working for me and it's only working if I add a char. Concatenating the number with a space is not working which in my opinion underlines that R interprets the input data on some level I cannot influence when using PA.
Since I should be fine with this workaround I'll mark this discusson as answered. Thanks again for your help.
Regards
Patrick
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.