[jaspDescriptives] Add option to display bar plots as proportions/percentages (0-100...#474
Open
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
Open
Conversation
…centages (0-100...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes: jasp-stats/jasp-issues#3953
Root cause
prop/condProp) only plotted proportions on a 0-1 scale and had no option to show 0-100 percentages with labels above bars.What changed
densityPlotPercentWithLabelsininst/qml/Descriptives.qml(enabled only forprop/condProp).R/descriptivesWrapper.R.R/descriptives.Rto:Why
Caveats / reviewer checks
"%3.0f%%"); review if decimal precision is desired.testAll()and directrunAnalysis()reproduction scenarios includingpropandcondProp.Implementation Plan
Root cause
Descriptives categorical frequency bars are built in
R/descriptives.R(.descriptivesDensityPlotsFill). FordensityPlotCategoricalType = "prop"/"condProp",Freqis plotted as raw proportions (0-1), and bars have no value labels. There is no GUI option to switch these categorical bars to 0-100 percentage display with labels.Proposed changes
inst/qml/Descriptives.qml:name: "densityPlotPercentWithLabels"proporcondPropR/descriptivesWrapper.R:@param densityPlotPercentWithLabelsdensityPlotPercentWithLabels = FALSER/descriptives.R:densityPlotPercentWithLabelsin density plot container dependencies.descriptivesDensityPlotsFillcategorical branch:Freqto percent (* 100)scale_y_continuous(limits = c(0, 100), ...))geom_textExpected test impact
Existing tests should stay stable because default is
FALSE; old behavior remains default.testAll()should pass unless hidden tests explicitly enable the new option.Add option to display bar plots as proportions/percentages (0-100 scale) with value labels above bars in Descriptives module
Test Results
Automated Code Review
Approved after 1 review iteration(s).