vertesy / MarkdownReports

Type Less, Plot More. Create and auto-annotated and -saved (base) plots with very little code, and write (markdown) reports easily from your R scripts.
https://vertesy.github.io/MarkdownReports
GNU General Public License v3.0
9 stars 7 forks source link

whist.back2back does not always work #85

Closed vertesy closed 6 years ago

vertesy commented 6 years ago

Does not always work - experimental. Problem is the separate binning.

If the bins are not equal, it breaks

SnowflakeSizes =  list (
    "Murmansk" = c(1.1, 1.111, 1.2, 1, 1, 1.4, 1.3),
    "Anchorage" = c(1.3, 1.41, 1.24, 1.6, 1.7, .9)
)
xx= whist.back2back(SnowflakeSizes)
xx
[[1]]
$breaks
 [1] 1.00 1.02 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.18 1.20 1.22
[13] 1.24 1.26 1.28 1.30 1.32 1.34 1.36 1.38 1.40

$counts
 [1] 2 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1

$density
 [1] 14.285714  0.000000  0.000000  0.000000  7.142857  7.142857
 [7]  0.000000  0.000000  0.000000  7.142857  0.000000  0.000000
[13]  0.000000  0.000000  7.142857  0.000000  0.000000  0.000000
[19]  0.000000  7.142857

$mids
 [1] 1.01 1.03 1.05 1.07 1.09 1.11 1.13 1.15 1.17 1.19 1.21 1.23
[13] 1.25 1.27 1.29 1.31 1.33 1.35 1.37 1.39

$xname
[1] "ListOf2[[1]]"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

[[2]]
$breaks
 [1] 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45
[13] 1.50 1.55 1.60 1.65 1.70

$counts
 [1] 1 0 0 0 0 0 1 1 0 0 1 0 0 1 0 1

$density
 [1] 3.333333 0.000000 0.000000 0.000000 0.000000 0.000000 3.333333
 [8] 3.333333 0.000000 0.000000 3.333333 0.000000 0.000000 3.333333
[15] 0.000000 3.333333

$mids
 [1] 0.925 0.975 1.025 1.075 1.125 1.175 1.225 1.275 1.325 1.375
[11] 1.425 1.475 1.525 1.575 1.625 1.675

$xname
[1] "ListOf2[[2]]"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
vertesy commented 6 years ago

removed from the package. Now part of CodeAndRoll.