Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

R Factors in Alteryx

Alteryx Partner

Hi everyone,


Coming from an economics and data science background, I'm really enjoying using Alteryx and R together to make the most of my data. In Economics, Categorical data comes up quite a lot in analyses, and is handled in R quite easily using the "Factor" data type. I was wondering how Alteryx would handle this data type coming out of an R Tool, since in R, its treated somewhere between a string and an integer.






It will actually code the output as a V_WString. I attached a simple workflow.


It passed a text input into the R tool as a data frame, then it codes the column as a factor. I then output the data frame to Alteryx and use a Select tool to determine the variable type.









ACE Emeritus
ACE Emeritus

Hi @tcroberts

Interesting question: it looks like they are treated as strings... although you can control what you want easily enough:

df1 <- read.Alteryx("#1", mode="data.frame")
df2 <-
df3 <-

DF2 should give you a factorized version of DF1, which is sent to output 2... DF3 gives you the numeric values of DF2, sent to output 3.  You can see that output 2 has the string values for the factors; output three will have the numeric values.

Hope that helps!




Alteryx Partner

Hmm, thats interesting. Thanks for testing this out! Its good to know that its fairly easy to get the different attributes from a factor.


I wonder if there's been any discussion about creating ordinal or categorical variable types within Alteryx. In a recent workflow, I needed to create numeric proxies for a string variable in order to sort and perform some other operations. My job would've been made much easier by a tool that creates an ordinal field, and my mind immediately went to factors in R.