Doing Some Actual Data Science
At this point you've learned how to work with variables and datatypes, hand-jam data, and read it in from a CSV. But how do you actually use the algorithms you learned earlier in this book? Since you already have the wine data loaded up, you'll start with a little k-means clustering.
Spherical K-Means on Wine Data in Just a Few Lines
In this section, you'll cluster based on cosine similarity (also called spherical k-means). And in R, there's a spherical k-means package you can load, called skmeans
. But skmeans
doesn't come baked into R; it's written by a third party as a package that you can load into R and use. Essentially, these geniuses have done all the work for you, and you just have to stand on their shoulders.
Like most R packages, you can read up on it and install it from the Comprehensive R Archive Network (CRAN). CRAN is a repository of many of the useful packages that can be loaded into R to extend its functionality...