Alteryx Designer Desktop Discussions

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

Strange behavior with Alteryx R Tool and R Terminal

tonyppham503
8 - Asteroid

I'm getting mixed results between using Alteryx's R Tool vs Altery'x R Terminal (C:\Program Files\Alteryx\Alteryx\R-3.3.2\bin)

 

 

When I run the following code within Alteryx's R Tool, these are the results: 

install.packages("readxl", repos = "http://cran.us.r-project.org", dependencies=TRUE) 
install.packages("tidyverse", repos="http://cran.rstudio.com/", dependencies=TRUE) 
install.packages("stringr", repos = "http://cran.us.r-project.org", dependencies=TRUE) 
install.packages("xlsx", repos = "http://cran.us.r-project.org", dependencies=TRUE) 
install.packages("binom", repos = "http://cran.us.r-project.org", dependencies=TRUE) 
install.packages("Rcpp", repos = "http://cran.us.r-project.org", dependencies=TRUE) 

library(readxl) #Read Excel files
library(tidyverse) #Data manipulation
library(stringr) #String manipulation
library(xlsx) #Write Excel files
library(binom) #Calculate Confidence Intervals for IIS data


Info: R (1): Warning: package 'Rcpp' is in use and will not be installed
Warning: R (1): package 'readxl' was built under R version 3.3.3 
Error: R (1): Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
Info: R (1):   namespace 'Rcpp' 0.12.8 is already loaded, but >= 0.12.13 is required
Info: R (1): In addition: Warning message:
Info: R (1): package 'tidyverse' was built under R version 3.3.3 
Error: R (1): Error: package or namespace load failed for 'tidyverse'
Error: R (1): Execution halted
Error: R (1): The R.exe exit code (1) indicated an error.

 

However, when I run the same code within the R Terminal found in the bin folder, it works perfectly. Seems like the Alteryx R Tool should work if the Alteryx R Terminal works? 

 

 

Alteryx R Tool .libPaths():

Info: R (1): R version 3.3.2 (2016-10-31) - x86_64
Info: R (1): rgeos version: 0.3-21, (SVN revision 540)
Info: R (1): GEOS runtime version: 3.5.0-CAPI-1.9.0 r4084
Info: R (1): Linking to sp version: 1.2-3
Info: R (1): Polygon checking: TRUE
Info: R (1): [1] "C:/Users/p474983/AppData/Roaming/Alteryx/R-library"
Info: R (1): [2] "C:/ProgramData/Alteryx/R-library"
Info: R (1): [3] "C:/Program Files/Alteryx/R-3.3.2/library"

 

 

Alteryx R Terminal .libPaths()

[1] "C:/Program Files/Alteryx/R-3.3.2/library" 

9 REPLIES 9
tonyppham503
8 - Asteroid

I also tried to reinstall Rcpp and got this:

 

detach("package:Rcpp", unload = TRUE)
install.packages("Rcpp", dependencies=TRUE)

 

Error: R (1): Error: package 'Rcpp' is required by 'AlteryxRDataX' so will not be detached

tonyppham503
8 - Asteroid

I closed Alteryx and the R Terminal and then ran the following 

 

detach("package:Rcpp", unload = TRUE)
install.packages("Rcpp", dependencies=TRUE)

 

Reopened Alteryx and was able to run my script. 

arindam2007b
6 - Meteoroid

If I am closing both R and Alteryx, where do I run the mentioned command? 

tonyppham503
8 - Asteroid

I re-opened the R Terminal and ran the commands. 

arindam2007b
6 - Meteoroid
I opened r terminal, installed the packages, it got installed. But then
when i open r tool via Alteryx and library those packages it throws the
same error in Alteryx. My work's stuck because of this.
tonyppham503
8 - Asteroid

You installed using Alteryx's R Terminal? Not whichever you use for R Studio or something?

arindam2007b
6 - Meteoroid
Yes, I installed it via r terminal of Alteryx which is in C:\Program
Files\Alteryx\R-3.3.2\bin. I have a separate instance of R version 3.4
installed in my system. The libraries of R is
in C:\Users\hp\Documents\R\win-library\3.4 and there's another folder where
libraries of R version of 3.3 i.e. C:\Users\hp\Documents\R\win-library\3.3,
which is the version Alteryx use.
I have a seperate R library folder in Alteryx ~ C:\Program
Files\Alteryx\R-3.3.2\library. I have specified the .libpath for this
specific folder.
SydneyF
Alteryx Alumni (Retired)

Hi @arindam2007b

 

Are you using an Admin or Non-Admin version of Alteryx? Can you please try running .libPaths() in the R Tool, and seeing what file-paths are listed in the Results Window?

kinjalghoshal1
5 - Atom

Following is my libPaths() output. I am using a non-admin Alteryx version. I have installed the required libraries to all those paths except the 2nd one.

 

R (1) [1] "C:/Users/ghoshalk2/AppData/Local/Alteryx/R-3.5.3/library"
R (1) [2] "\\\\145.230.101.194/vdc-rat$/FolderReDir/ghoshalk2/AppData/Roaming/Alteryx/R-library"
R (1) [3] "C:/ProgramData/Alteryx/R-library"
R (1) [4] "C:/Users/ghoshalk2/Documents/R/win-library/3.5"

Labels