vertesy / ggExpress

ggExpress is the fastest way to create, annotate and and save plots in R.
https://vertesy.github.io/ggExpress
GNU General Public License v3.0
4 stars 2 forks source link

qbarplot seem to add up data in the final element #25

Closed vertesy closed 2 years ago

vertesy commented 2 years ago

Description

qbarplot seem to add up data in the final element. It seem to maybe come from qqqCovert.named.vec2tbl

Expected Behavior Should strip names, but not adding up values.

Buggy Behavior image

datX = c(A.1 = 15273817120.75, A.2 = 19748042499.75, A.3 = 19015562583.97, A.4 = 19539107256.48, A.5 = 20293595960.89, A.6 = 18401588363.56, A.7 = 18876623322.12, A.8 = 20113344495.41, A.9 = 19759801754.07, A.10 = 19862305126.29, B.1 = 14049263285.29, B.2 = 15310874767.7, B.3 = 13316238905.88, B.4 = 13053793265.22, B.5 = 12451837184.56, B.6 = 15095732257.66, B.7 = 13793883930.1, B.8 = 14145915911.97, B.9 = 14029136875.07, B.10 = 16434420425.09, C.1 = 16634725276.67, C.2 = 17635189764.07, C.3 = 18453442284.71, C.4 = 18140879520.46, C.5 = 19454822015.85, C.6 = 19472830899.79, C.7 = 19187828858.17, C.8 = 19290220121.02, C.9 = 19176960564.72, C.10 = 18101441453.02, D.1 = 16194435630.05, D.2 = 18078756773.13, D.3 = 17579176095.34, D.4 = 16857272399.08, D.5 = 17902504889.1, D.6 = 17689611098.42, D.7 = 17892178766.36, D.8 = 17819751385.79, D.9 = 16896316453.25, D.10 = 17843222873.72, E.1 = 19266947287.15, E.2 = 19102158394.34, E.3 = 18135419322.44, E.4 = 18720949164.04, E.5 = 19172455475.47, E.6 = 17089109522.67, E.7 = 19203272180.69, E.8 = 19543017029.51, E.9 = 17488648870.63, E.10 = 18433494529.85, F.1 = 16373913388.65, F.2 = 17247845170.57, F.3 = 17309605641.54, F.4 = 16811631542.41, F.5 = 17734956810.56, F.6 = 17629744406.91, F.7 = 17552351271.36, F.8 = 17887451319.71, F.9 = 17912108211.29, F.10 = 18339746215.46, G.1 = 13032074439.62, G.2 = 13268056651.77, G.3 = 12768107933.15, G.4 = 11318557947.43, G.5 = 13112409433.13, G.6 = 12970230567.49, G.7 = 12447675596.99, G.8 = 11066276951.24, G.9 = 11787443223.6, G.10 = 14026544366.27, H.1 = 21877575254.63, H.2 = 24743269000.6, H.3 = 23873349116.16, H.4 = 25843702092.69, H.5 = 24832172670.89, H.6 = 26174812828.44, H.7 = 25820908847.56, H.8 = 24123991349.34, H.9 = 26286380503.78, H.10 = 1765156596.59, I.1 = 22004381857.62, I.2 = 19878260460.73, I.3 = 22679932183.01, I.4 = 21000909188.35, I.5 = 23336329575.16, I.6 = 23889551306.53, I.7 = 23551824810.83, I.8 = 21266124403.33, I.9 = 23571944492.02, I.10 = 1460005444.33, J.1 = 20887643832.89, J.2 = 22482078231.65, J.3 = 22819414495.48, J.4 = 24019122823.56, J.5 = 23243883898.4, J.6 = 22590511082.91, J.7 = 23752435598.41, J.8 = 22748121492.62, J.9 = 19315053455.04, J.10 = 1259362111.49, K.1 = 23540019932.29, K.2 = 24775818787.02, K.3 = 20386348553.98, K.4 = 25039316068.69, K.5 = 20917657564.64, K.6 = 20289950682.21, K.7 = 25211705926.88, K.8 = 23043947654.76, K.9 = 24970635486.15, K.10 = 1291511169.53, L.1 = 16237995863.11, L.2 = 20137547157.36, L.3 = 9704396265.18, L.4 = 19494896522.97, L.5 = 20357174248.84, L.6 = 20501902989.71, L.7 = 20507997756.31, L.8 = 20224579660.29, L.9 = 20472644107.52, L.10 = 1429814856.84, M.1 = 17093855098.68, M.2 = 22708468267.65, M.3 = 17112070009.12, M.4 = 19340725263.25, M.5 = 19109316557.26, M.6 = 9152375748.16, M.7 = 11789601377.25, M.8 = 10044131051.83, M.9 = 15977978843.56, M.10 = 12057889990.24, N.1 = 14309581287.03, N.2 = 16252468032.82, N.3 = 6968983806.91, N.4 = 13877044327.23, N.5 = 14220131960.2, N.6 = 9820674445.55, N.7 = 13536157372.82, N.8 = 13098031419.04, N.9 = 12511073551.64, N.10 = 12412045225.81, O.1 = 19985770044.07, O.2 = 18697038222.58, O.3 = 17542698389.18, O.4 = 17771104040.35, O.5 = 16599569895.31, O.6 = 20143989602.36, O.7 = 14641182791.99, O.8 = 15069290758.51, O.9 = 13971684113.31, O.10 = 7719658618.26, P.1 = 15105992372.21, P.2 = 15618543642.25, P.3 = 16519924399.5, P.4 = 18341317197.64, P.5 = 19920739997.97, P.6 = 14681411340.91, P.7 = 17025792187.53, P.8 = 13852606495.48, P.9 = 15357227597.44, P.10 = 15597400318.06, Q.1 = 18073761261.9, Q.2 = 15269826705.96, Q.3 = 19992603326.46, Q.4 = 13523915647.89, Q.5 = 19302407210, Q.6 = 13750064354.38, Q.7 = 13816139874.54, Q.8 = 17878540640.13, Q.9 = 21338075539.85, Q.10 = 11137639240.29)

qbarplot(datX)
vertesy commented 2 years ago

Ah, the problem comes from the fact, that qqqCovert.named.vec2tbl strips the names and ggbarplot stacks by name.

Solution: no names should be stripped, just not shown!

vertesy commented 2 years ago

It was indeed a No-names add up problem now it uses p <- p + ggplot2::guides(x = 'none') to remove names