community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Help! Using R in Alteryx to extract list of available files

Atom

I am planning on using Alteryx as part of the ETL process for our data warehouse. All of the data will initially be loaded to S3 and we will be using Alteryx to download and transform the data before pushing it to the DWH. The timings of the data load to S3 varies on a daily basis and so I am planning on using to some macros to check when the data is available. The way that I was planning on doing this was through some R code by retrieving a list of the files that are available in our S3 bucket. If the files that I require are available then the filename will be loaded in to the Amazon S3 Download tool but if not, it will try again until the data is available. I have managed to get the code working on RStudio but I keep getting errors when I load it in to Alteryx and unfortunately I don’t have the R knowledge to know how to fix it. Can anyone out there help me? :) 

 

The code that I currently have is as follows:

 

if (!require("devtools")) {

install.packages("devtools", repos="http://cran.ma.imperial.ac.uk/")

 library("devtools")

}

if (!require("magrittr")) {

install.packages("magrittr", repos="http://cran.ma.imperial.ac.uk/")

 library("magrittr")

}

install_github("cloudyr/aws.s3")

library("aws.s3")

 

if (!require("tidyverse")) {

install.packages("tidyverse", repos="http://cran.ma.imperial.ac.uk/")

 library("tidyverse")

}

 

Sys.setenv("AWS_ACCESS_KEY_ID" = "**************",

           "AWS_SECRET_ACCESS_KEY" = "*******************************",

           "AWS_DEFAULT_REGION" = "s3-eu-west-1.amazonaws.com")

 

##  List files in bucket

files <- get_bucket('**********')

 

##  Convert files to tidy

files_df <-

tibble::data_frame(

file = character(),

LastModified = character()

)

 

n_files <- length(files)

for(i in 1:n_files) {

files_df <-

tibble::data_frame(

file = files[i][[1]]$Key,

LastModified = files[i][[1]]$LastModified

) %>%

dplyr::bind_rows(files_df)

}

rm(n_files)

head(files_df)

 

The error that I am currently receiving is: Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])  

Alteryx Certified Partner

In the Alteryx Results window, the lines below the error line should provide comments with more information on which packages and versions are the problem. Here's an example I made in Alteryx Designer v10.6:

 

R Version Error.png

 

 

 

 

 

 

 

 

 

 

 

 

 

This topic has a lot of good information about resolving version issues:

https://community.alteryx.com/t5/Data-Preparation-Blending/R-Tool-version-Error/td-p/6427

 

 

 

Labels