This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Apologies for asking but I was hoping that someone here might have already used the R Tool for producing charts and might show me how it is done. I have attached an example but don't seem to be able to reproduce the inbuilt Charting tools output. I am hoping that once I can see it in action that I will be able to move on myself.
For simplicity, I focus on the first option, rather than plotly, in the attached workflow. The workflow uses a BlockUntilDone tool to run the R script which stores the chart as a .png; then the next step grabs the PNG and renders the image, similar to what you had in your stream. (But if the .PNG suits your needs, then you could just run straight into the R tool and call it done).
Many thanks for the prompt and great response. I was hoping that someone might show me how to unleash the complete power of R graphics by showing how to specify some of the options such as colour and size.
I added some minimal options to the workflow in the attached; it uses color brewer to choose a color palette, and allows specification of length/width of resulting PNG. For really advanced stuff, Id switch to plotly though.
A-ha, I learned something new today. Replace the code in the R tool with the following, and the #1 output will contain the plot in-line.
With that, you can remove the block-until-done, etc... and just run the R-tool inline with everything else.
#pd = pie data
pd <- read.Alteryx("#1", mode="data.frame")
#po - pie options
po <- read.Alteryx("#2", mode="list")
c <- brewer.pal(n=nrow(pd),name=po$pal)
AlteryxGraph(1, width=po$length, height=po$width)
#Insert code to plot graph here
pie(pd$NoOfAccounts, pd$BusinessUnit, col=c)
(Also working on a plotly version; will post once it works inline).
Edit: plotly from the R tool is a no-go for the time being...)