Description Usage Arguments Value Examples
View source: R/plottingKmeans.R
Create cluster variable plot.
1 2 3 4 |
km |
an object of class |
include |
a vector of column names to include. Plot never contains variables other than in the list.
Plot would never include |
except |
a vector of column names to exclude. Plot never contains variables from the list. |
baseSize |
|
baseFamily |
|
title |
plot title. |
ticks |
|
defaultTheme |
plot theme settings with default value |
themeExtra |
any additional |
... |
other parameters being suplied to geom's |
ggplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | if(interactive()){
# initialize connection to Lahman baseball database in Aster
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")
km = computeKmeans(conn, "batting", centers=5, iterMax = 25,
aggregates = c("COUNT(*) cnt", "AVG(g) avg_g", "AVG(r) avg_r", "AVG(h) avg_h"),
id="playerid || '-' || stint || '-' || teamid || '-' || yearid",
include=c('g','r','h'), scaledTableName='kmeans_test_scaled',
centroidTableName='kmeans_test_centroids',
where="yearid > 2000")
km = computeClusterSample(conn, km, 0.01)
createClusterPairsPlot(km, title="Batters Clustered by G, H, R", ticks=FALSE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.