Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

R Tool Runs until I get a macro

jbh1128d1
10 - Fireball

So I have an r script that ran great, which I wanted to turn into a macro(s).  Thanks to @AmeliaG, and @MarqueeCrew, I was able to get the macro built but my code no longer works.  I not get an error (using the same data) "cannot allocated vector of size 141.5 Gb. " 


The first macro constructs the formula string (fit <- glm(freq ~ State_bucket + eff_year + channel + marital_status + usage + term + pay_plan + bSpline(age, degree = 1, knots = c(27, 70)) + vehicle_type + bSpline(vehicle_age, degree = 1, knots = c(6, 17)) + bSpline(RBA, degree = 1, knots = c(2750,26750)) + bSpline(vehicle_length, degree= 1, knots = c(45)) + bSpline(Credit, degree = 1, knots = c(375)), family = quasipoisson(link="log"), data = the_data) to be inserted into the 2nd macro (r-script)

formulaconstructmacro.JPG

 

The second macro takes the formula string and inserts it via control parameter into the r-script.

 

rscript.JPG

When I run the macro though, I get the "cannot allocated vector of size 141.5 Gb. " though even though the workflow will run without being a macro.  Can anyone help me figure out why?

2 REPLIES 2
KaneG
Alteryx Alumni (Retired)

I had a quick look but without the training data etc, it was a little hard to see. I also had to install the splines2 package. 

 

install.packages(c("splines2"), repos="https://cran.csiro.au/")

Is there any chance that you could package the workflow including macros etc (Options > Export Workflow), so that it's easier to see just what data is being passed and run each of the macros independently?

 

jbh1128d1
10 - Fireball

Thank you for the reply.  Yes, you do need splines2.  I ended up bringing the string into the r input as a data frame and copying the method used in the out of the box count regression tool to use as a formula. 

 

Thanks sgain for for the reply and I will use that technique next time I run a macro similar to what I have. 

Labels