Code
using TidierPlots,RCall
using DataFrames,Random
Random.seed!(121212)
TaskLocalRNG()
用于单一属性的频数统计
lock5 stat
中会大量使用这个方法using TidierPlots,RCall
using DataFrames,Random
Random.seed!(121212)
TaskLocalRNG()
=rand(1:20,100)
raw=DataFrame(x=raw)
dfshow(df)
100×1 DataFrame
Row │ x
│ Int64
─────┼───────
1 │ 19
2 │ 2
3 │ 15
4 │ 16
5 │ 16
6 │ 18
7 │ 15
8 │ 13
9 │ 12
10 │ 2
11 │ 20
⋮ │ ⋮
91 │ 3
92 │ 12
93 │ 8
94 │ 16
95 │ 3
96 │ 3
97 │ 8
98 │ 14
99 │ 14
100 │ 12
79 rows omitted
@rput df
"""
R library(ggplot2)
ggplot(df, aes(x = x)) +
geom_dotplot(dotsize = .75, stackratio = 1.2,
fill = "steelblue") +
scale_y_continuous(NULL, breaks = NULL) +
labs(title = "Stacked Dot Plot", x = "Data Values") +
theme_minimal()
"""
┌ Warning: RCall.jl: Bin width defaults to 1/30 of the range of the data. Pick better value with
│ `binwidth`.
└ @ RCall ~/.julia/packages/RCall/gOwEW/src/io.jl:172
RObject{VecSxp}