We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Benford Analysis - R Tool - Infinete Loop

marcoscaceres
6 - Meteoroid

I'm having trouble running code in "R" with the Alteryx "R tool".

I tested the code in an environment outside of Alteryx and it is working perfectly, but when I test this code inside the tool in Alteryx, it enters an infinite loop and never finishes the workflow.

 

Some steps:
1 - I tried to install the "benford.analysis" R library directly through Alteryx on the command line and it returns: "package "benford.analysis" is note available for this version of R".
2 - If I run the script without trying to install the library, just calling it from the one already installed on my computer, Alteryx runs in an infinite loop.

 

I share the code:
"result <- read.Alteryx("#1", mode="data.frame")
install.packages("benford.analysis", repos="https://cran.r-project.org/web/packages/benford.analysis.index.html/")
library(benford.analysis)
bfd.cp <- benford(result$AmountPaid) ##running benford tests on column "AmountPaid" in a variable.
write.Alteryx(bfd.cp, 1)
suspects2 <- getSuspects(bfd.cp, result) ##capturing the suspects.
write.Alteryx(suspects2, 2)
AlteryxProgress(1)

Basically, the code is for the library to analyze some payments and get back to me which payments might be possible fraud.

2 REPLIES 2
gautiergodard
13 - Pulsar

Hey @marcoscaceres 

Is there any reason why you are building the benford analysis in R?

You can re-create this in Alteryx, here is a link that shows you how:

 

Benford's Law Analysis - Alteryx Community

marcoscaceres
6 - Meteoroid

Hey @gautiergodard .
Thanks ur answer.

Yes, I need to use this library because in addition to using the Benford analysis tool, I use other tools made available.

Labels
Top Solution Authors