scicloj.metamorph.ml.pretty
pretty
(pretty s opts impl)Compute pretty breaks using R function base::pretty.
Parameters:
ssequence of valuesoptsoptions for pretty,:nnumber of breask is supported by all implementations
-
implAn implementation keyword, either:ocpuUses an online service https://www.opencpu.org/api.html (server: cloud.opencpu.org):renjineUses https://renjin.org/:clojisrUses https://github.com/scicloj/clojisr, which requires a local R installation:wadogoUses plotje/wadogo (which has quite different notion of ‘pretty’ compared to R)
Each implementation requires dependencies to be added:
:ocpu: opencpu-clj/opencpu-clj “0.3.1”:renjin: org.renjin/renjin-script-engine “3.5-beta76”:clojisr: scicloj/clojisr “1.1.0”
Returns seq of the breaks, which R considers ‘pretty’
Examples
Use wit rejin
(pretty (range 0 11) {:n 7} :renjin)
;;=> (0 2 4 6 8 10)Use wit wadogo
(pretty (range 0 1 0.1) {:n 5} :wadogo)
;;=> (0.0 0.2 0.4 0.6 0.8 1.0)