Alter y XR Cheat Sheet

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

R Functions in Alteryx :: CHEAT SHEET

R Tool Inputs and Outputs Messages Metadata


read.Alteryx("#1", mode = "data.frame") AlteryxProgress(0.25) if(AlteryxFullUpdate)
Stream in a connected data input to the R Tool. Set Script Completion Progress in 25% increments. Determines if Alteryx is refreshing, which allows
Options for mode include "data.frame" or "list". metadata to update. Can be used with an ifelse
AlteryxMessage("message", msg.costs$INFO, statement to run MetaInfo functions during refresh.
read.Alteryx.First("#1", 5000, mode = "data.frame") priority.consts$LOW)
Stream in values in chunks by adding a number of Write messages to the results window. Options for read.AlteryxMetaInfo("#1")
records argument. Replace First with Next to get the msg.costs are INFO, WARNING, FIELD_CONVERSION Stream in connected input’s metadata.
next chunk of records. ERROR, or ERROR. Options for priority.consts are LOW
MEDIUM, or HIGH. write.AlteryxAddFieldMetaInfo(1, name = "Column",
write.Alteryx(OutputObject, 1) fieldType = "String", size = 15, source = "RTool",
Writes data out of R Tool to one of five anchors. stop.Alteryx("message") description ="fieldInfo")
Stop running R code with an error message. Streams out metadata from a single column to the
Reading and Writing R Objects specified output anchor.
Which Version of R is Alteryx Using?
the.obj <- vector(mode="list", length=2) write.AlteryxGraphMetaInfo(1)
the.obj[[1]] <- c(model.name) R.Version()$version.string Streams out graph metadata from R Tool to the
the.obj[[2]] <- list(the.model) Returns the current R version in use. specified anchor.
names(the.obj) <- c("Name", "Object")
Alteryx Version R Version
Convert model object to writeable format. Installing Packages
10.6 3.2.3
unserializeObject(as.character(model_df$Object)) install.packages("pkg", repos =
Convert model object back to R format. 11.0 - 2018.1 3.3.2 "http://cran.rstudio.com")
≥2018.2 3.4.4 When installing with the R Tool, be sure to specify the
repository option, or the install will fail.
Writing out Plots
Interface Tools & Environmental Variables
WHR <- graphWHR(inches = "True", in.w = 4, in.h =
4, resolution = "2x", print.high = FALSE) %VariableType.<VariableName>%
Developing R Code for Alteryx
Function that creates an object that can define The syntax for accessing environmental variables in https://github.com/alteryx/jeeves
parameters of AlteryxGraph. the R Tool, where VariableType is the Type of This package can be used to assist with development of
variable, and <VariableName> is the specific Name of code intended for use in Alteryx.
AlteryxGraph(1, width = WHR [1], height = WHR[2], the variable.
res = WHR[3], pointsize = 9) install.packages(“jeeves", repos =
Creates a plot in one of five output anchors. Plot Variable Variable Type 'http://alteryx.github.io/jeeves’)
code immediately following this function will be Install the package binary from github.
written out to the specified anchor. Interface Tool Question
Engine Variable Engine devtools::install_github(“alteryx/jeeves")
invisible(dev.off()) Build the package from source.
Closes the plot windows created by R. User Variable User

You might also like