Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Radio Button Not Working

jbh1128d1
10 - Fireball

Hello,

 

I'm trying to use a radio button to update the distribution of my piece wise linear regression macro. I copied the glm tool macro language to pull in the distribution of the glm as such:

is.XDF <- FALSE 
if (!is.XDF) {
if ('%Question.Quasipoisson%' == "True")
the.family <- "quasipoisson(link='log')"
if ('%Question.Gamma%' == "True")
the.family <- "gamma(link='log')"
} else {
the.family <- "quasipoisson(link='log')"
}
# Create a string of the potential predictors seperated by plus signs
the_preds <- paste(names(the_data)[-1], collapse = " + ")
# Get the name of the target field
the_target <- names(the_data)[1]
# Create a formula expression from the names of the target and predictors
the_form <- as.formula(paste(the_target, the_preds, sep = " ~ "))
# Run the model
fit1 <- glm(the_form, "family = " the.family , data = the_data)
#

And I do not have the radio buttons connected to anything (like the count regression tool has it set up):

radio button.JPG

I'm not sure why the code is not working.  The error I get is unexpected symbol in "fit1 <- glm(the_form, "family =" the.family

 

2 REPLIES 2
jrgo
14 - Magnetar

@jbh1128d1

 

If you added those radio button yourself, my guess is that you didn't update the tool name, and not referring to the question to be displayed.

 

Click on the radio button and in the configuration screen, select the "Annotation" icon. Name this to what you'll want to use in your R script.

image.png 

 

This is the value that you'd use in '%Question.<ToolName>%'.

 

Hope this helps!

jbh1128d1
10 - Fireball

Thank you @jrgo.  Worked like a charm. 

Labels
Top Solution Authors