top of page
  • Writer's pictureAntoneely Calizaya

How to integrate Alteryx with R

You just found out about Alteryx’s R tool, which lets you bring your code to Alteryx. Want to learn more? How to install R packages? The configuration? How to see the results? Here, I’ll walk you through some basics to get you started integrating Alteryx with R. Here we go!

Introduction: The R tool

In terms of speed and versatility, I find R to be particularly useful when analyzing big data or performing predictive analytics. To learn more here. Your workflow at the end of this blog should look like this. Without more introduction, let’s begin.

1. Finding the tool Let’s drag the R Tool to the canvas. You could search for it or go to the Developer Tab.

2. Installing the famous R packages For this example, I want to install ggplot2 to make some visualizations. You can do this by adding the line of code below to the configuration and clicking Run (shortcut Ctrl+R). Once the process is complete, you will see in the Results window that the packages have been downloaded to your local computer. Only once needs it to be installed, but you must use the second line of code whenever you want to use the libraries.

install.packages(“ggplot2″, repos=””) library(ggplot2)

3. Connect the R tool to the data and output the results So, you installed and loaded all the libraries that your code needs. Now it’s time to start putting your code into action. You need to make two configurations: input the raw data and output the results. Let’s input the data by clicking Insert Code, Read Input “As Data Frame”.

Then, to create a variable with the data you will use “books <-“. This is what it will look like. Please note that I named my data “books” for this example, but you can name yours however you prefer.

For this example, I will plot a graph. To output, the results, click on Create Graph, choose the plot type and output 1. Then you will add a browse tool to the first output. For a data frame, you will click on Write-Output instead.

4. Bring your code Let’s begin with the magic. Now it’s time to paste your code into the R tool configuration after creating the variable. I will use the scripts below from a previous project. Click here to see the entire project, a Kaggle competition EDA.

5. See the results For this example, I plotted a graph. To this point, you had successfully installed and loaded the libraries, connected the R tool to the data and output the results, and brought your code to action into the R tool configuration. Finally, let’s Run it. That’s it, click on the browser tool to see the results. So exciting!

With the basics covered, you can configure and integrate Alteryx with the R tool. In my next blog, I will demonstrate how to do predictive analytics using the R tool. While Alteryx offers a wide range of Predicting tools, the R tool is quite handy as well.

See you soon on my next blog, and if you’re looking for new tunes while learning new cool stuff or preparing for your Alteryx certification, check out my Spotify playlist here.

1 view0 comments


bottom of page