From the course: Tableau and R for Analytics Projects
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create a centroid-based clustering model in R
From the course: Tableau and R for Analytics Projects
Create a centroid-based clustering model in R
- [Tutor] Many R packages implement cluster analysis algorithms, but I've selected one that uses a centroid-based method to identify its clusters. That's the type of method that I demonstrated in the previous movie. In this movie I will show you how to identify clusters in R using data you import from a CSV data file. I've started off at a blank console in R, and I will actually increase the size of my console window a bit so I don't have to wrap lines. The first thing to do is to load our data into a data frame. So I will start by typing the name of the variable. I'll just make it sales, and then the assignment operator, a less than sign followed by a hyphen, looks like a left-pointing arrow. Now we need to use the read.table method. So I'll do read.table, and now I need to identify the file using its full path on my system, the separator character, and also whether there's a header row or not. So I'll start by typing a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.