Anscombe's quartet
val df =
DataFrame.readCSV(
"https://gist.githubusercontent.com/ericbusboom/b2ac1d366c005cd2ed8c/raw/c92c66e43d144fa9c29dbd602d5af6988e8db533/anscombes.csv",
parserOptions = ParserOptions(locale = Locale.ENGLISH)
)
df.head()
id | dataset | x | y |
---|---|---|---|
0 | I | 10 | 8.04 |
1 | I | 8 | 6.95 |
2 | I | 13 | 7.58 |
3 | I | 9 | 8.81 |
4 | I | 11 | 8.33 |
df.describe()
name | type | count | unique | nulls | top | freq | mean | std | min | median | max |
---|---|---|---|---|---|---|---|---|---|---|---|
id | Int | 44 | 44 | 0 | 0 | 1 | 21.5 | 12.845 | 0 | 21 | 43 |
dataset | String | 44 | 4 | 0 | I | 11 | null | null | I | II | IV |
x | Double | 44 | 12 | 0 | 8.0 | 13 | 9 | 3.199 | 4.0 | 8.0 | 19.0 |
y | Double | 44 | 43 | 0 | 8.84 | 2 | 7.501 | 1.959 | 3.1 | 7.52 | 12.74 |
df.plot {
points {
x("x") {
scale = continuous(0.0..20.0)
}
y("y") {
scale = continuous(0.0..20.0)
}
color(dataset)
size = 5.0
}
abLine {
slope.constant(0.5)
intercept.constant(3)
width = 1.7
alpha = 0.7
}
facetWrap(nCol = 2) {
facet(dataset)
}
}
Last modified: 05 December 2023