Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Install R Packages in Alteryx Deisgner

abhinav19
6 - Meteoroid

Please help.  I am getting below error when i try to install r packages in Alteryx

Code: install.packages(c("geosphere"), repos="http://cran.stat.nus.edu.sg/")

 

Error:

Info: R (4): Warning in install.packages(c("geosphere"), repos = "http://cran.stat.nus.edu.sg/") :
Info: R (4): 'lib = "C:/Program Files/Alteryx/R-3.4.4/library"' is not writable
Error: R (4): Error in install.packages(c("geosphere"), repos = "http://cran.stat.nus.edu.sg/") :
Info: R (4): unable to install packages
Error: R (4): Execution halted

16 REPLIES 16
timrains
8 - Asteroid

Hi @alteryx_user

 

I can't help directly on the GXBoost side, but i did have a similar issue with another R package. I think this error comes when one of the dependent packages is not up to date.

 

In the first instance, you can try to install the readr package using the R terminal directly. Go to 

C:\Program Files\Alteryx\R-3.4.4\bin (or whatever Alteryx install folder you are using), open the terminal (run as admin) and type this (changed for your folders as required). 

 

install.packages("readr",  dependencies = TRUE, repos = "http://cran.us.r-project.org", lib = "C:\\Program Files\\Alteryx\\R-3.4.4\\library")

 

That should install an up to date version. If that doesn't work, it may be one of the dependent packages that is not up to date. In this case, the first thing to try is to figure out which package this is. I did this by trying to install the package using the R tool from the developer tab. In your case something like this should work - you just need any data stream to go in. 

 

# Spatial objects returned as strings, use unserializeObject() to decode individual cells
the.data <- read.Alteryx("#1", mode="data.frame")
AlteryxMessage("Data Loaded as DF", msg.consts$INFO, priority.consts$LOW )

#conditional install function to install the package if not already there. 
cond.install <- function(package.name){
options(repos = "http://cran.rstudio.com") #set repo
#check for package in library, if package is missing install
if(package.name%in%rownames(installed.packages())==FALSE) {
install.packages(package.name)}else{require(package.name, character.only = TRUE)}}

#call the function
cond.install("readr")

 

And after that you should get a message in the Alteryx results window which mentions a package and a version requirement - in my case it was the last line.  

 

Then you can try to re-install this package to your R library using the same R terminal approach mentioned first. (see this link for more detail) 

 

install.packages("YOUR PACKAGE",  dependencies = TRUE, repos = "http://cran.us.r-project.org", lib = "C:\\Program Files\\Alteryx\\R-3.4.4\\library"). 

 

Hope this helps, however please bear in mind no guarantees that fixing any dependecies wont have any knock on effects elsewhere in the R tools within Alteryx (heopfully not). 

 

Cheers

 

Tim

DiganP
Alteryx Alumni (Retired)
rjanezic
7 - Meteor

After opening this application I'm not really sure how to use it. The only section that is clear is typing out the packages and using a comma between each package. Everything else is pretty unclear on what needs to be done. For example what is "Install the package(s) to your default personal directory"? Another example, what's "Select the folder where you would like the package(s) installed (you must have write permissions)"?

CarlaB
5 - Atom

Hello, 

 

I'm facing the same errors but i'm unable to access the workflow you shared. 

 

Thank you

chinta
7 - Meteor

Hi, 

 

Can you please update the link as I am getting Access Denied message? 

 

Best, 

Andrzej
8 - Asteroid

Hi @DiganP 

 

I don't have access to this workflow, could you share it with me?

bb213
8 - Asteroid

@timrains This worked for me, thanks.  The library needed to be installed in that specific folder because the version of R that alteryx is using is not the version of R that I use on a regular basis. 

Labels