Clustering using R and Tableau

0 votes

Clustering using R and Tableau

Jun 19 in Tableau by cherukuri sindhu
70 views

1 answer to this question.

0 votes

Let me explain with a simple explanation of forming cluster using Sales, Profit, and discount.

Follow the below steps:

1. Create a chart like below

2. Create a calculated field as below

Explanation to the field code - 

  • Set,seed() is to Set the seed of R's random number generator, which is useful for creating simulations or random objects that can be reproduced. It can be omitted if wanted.
  • kmeans() is a function that performs the actual operation of forming clusters. It takes 2 parameters arguments and the number of clusters. arguments are taken from the expression in SCRIPT_REAL() function. The number of clusters can be static or dynamic by using a parameter to provide value.
  • data.frame() is used to convert the list of columns into a data frame and pass it as an argument to R functions.
  • .arg1,2,3 are arguments that are used in external scripts that fetch the value from tableau variables( fields, parameters, calculated fields) to perform any operations.

3. Drop the created field in the color shelf to observe the clusters.

Let me show you the difference between R and Tableau Clusters using sales-profit and discount

R cluster - using the created field in tableau

Tableau Clusters - using tableau inbuilt Clustering

Hope it helps you!

answered Jun 19 by Cherukuri
• 26,020 points

Related Questions In Tableau

0 votes
1 answer

Can someone tell me about some tips and tricks while using tableau?

1. Tableau tips and tricks: Calendar in ...READ MORE

answered Jul 3, 2018 in Tableau by Atul
• 5,530 points
31 views
+1 vote
1 answer

How to authenticate and embed Tableau Rest API using Python 2.7

Your .format() call is creating a bad ...READ MORE

answered Jul 18, 2018 in Tableau by Atul
• 10,240 points
455 views
0 votes
1 answer

How can I calculate the median of sales price using 3 variables in Tableau

First let me clarify things for you. ...READ MORE

answered Apr 11, 2018 in Tableau by xyz
• 1,550 points
646 views
0 votes
0 answers

pre-requisites to learn Tableau and R

What are the pre-requisites to learn Tableau ...READ MORE

May 10, 2018 in Tableau by GandalfDwhite
• 1,320 points
25 views
0 votes
1 answer

Setup R in Tableau

Follow the below steps: 1. Install R studio from ...READ MORE

answered Jun 19 in Tableau by Cherukuri
• 26,020 points
41 views
0 votes
1 answer

Error: package or namespace load failed for ‘mvoutlier’

Hi Sindhu, The error tells that JAGS .exe ...READ MORE

answered Jun 19 in Tableau by Cherukuri
• 26,020 points
95 views
0 votes
1 answer
0 votes
1 answer

Find outliers in data using R in tableau

Hi Nithin, Follow the below steps: 1. Connect to ...READ MORE

answered Jun 19 in Tableau by Cherukuri
• 26,020 points
97 views
0 votes
1 answer

Forecast using R in Tableau

Let me explain using example forecast of profit ...READ MORE

answered Jun 20 in Tableau by Cherukuri
• 26,020 points
61 views