Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Mean plots CV% #103

Merged
merged 64 commits into from
Nov 8, 2024
Merged

Enhancement: Mean plots CV% #103

merged 64 commits into from
Nov 8, 2024

Conversation

js3110
Copy link
Collaborator

@js3110 js3110 commented Oct 25, 2024

Issue

Closes #95

Description

Mean plots additional option to show CV% as well as standard deviation

Definition of Done

  • Mean plots show CV% when selected
  • Confidence intervals showed as shaded areas (user change of mind)

How to test

Outputs -> Mean plots -> Show CV%

Contributor checklist

  • Code passes lintr checks
  • Code passes all unit tests
  • New logic covered by unit tests
  • New logic is documented

@js3110 js3110 linked an issue Oct 25, 2024 that may be closed by this pull request
2 tasks
@m-kolomanski m-kolomanski requested review from m-kolomanski and removed request for m-kolomanski October 25, 2024 12:16
@m-kolomanski m-kolomanski self-requested a review October 31, 2024 13:36
Copy link
Collaborator

@m-kolomanski m-kolomanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, good job in general, code works and is quite clean, thanks for including fine-grained the tests, however I have few comments:

issue(blocking): Code does not pass devtools::lint() check.

question, suggestion: For datapoints close to zero, CV is so large that the line is completely horizontal - is that expected and correct behaviour? Migth be worth setting some limits to keep the plot readable?

suggestion: When both SD and CV are selected, they will overlap each other. Might be worth thinking about different approach to display them, or allow only one at the time (in the UI, if one is selected, the other is automatically deselected).

R/general_meanplot.R Outdated Show resolved Hide resolved
inst/shiny/tabs/outputs.R Outdated Show resolved Hide resolved
inst/shiny/ui.R Outdated Show resolved Hide resolved
tests/testthat/test-general_meanplot.R Outdated Show resolved Hide resolved
@js3110 js3110 requested a review from m-kolomanski November 4, 2024 08:29
@js3110 js3110 requested a review from m-kolomanski November 8, 2024 10:26
Copy link
Collaborator

@m-kolomanski m-kolomanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, looks fine, I have just a minor issue regarding the naming of variables.

I can see that spellcheck and lintr CI are failing, but looking at the errors, I think it is due to lacking WORDLIST and some rules from .lintr on this branch. Rebasing to main or copying those files over should solve the issue, but might create some conflicts that might have to be solved before merging.

R/general_meanplot.R Outdated Show resolved Hide resolved
geom_line(aes(colour = id_variable)) +
geom_point(aes(colour = id_variable)) +
facet_wrap(~groups,
strip.position = "top") +
labs(
x = paste0("Nominal Time [", preprocessed_data$RRLTU[1], "]"),
x = paste0("Nominal Time [", timeunit, "]"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x = paste0("Nominal Time [", timeunit, "]"),
x = paste0("Nominal Time [", time_unit, "]"),

y = paste0(
"Mean concentration", " [", paste(unique(preprocessed_data$AVALU), collapse = ","), "]"
"Mean concentration", " [", concunit, "]"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Mean concentration", " [", concunit, "]"
"Mean concentration", " [", conc_unit, "]"

js3110 and others added 2 commits November 8, 2024 14:46
Co-authored-by: Mateusz Kołomański <[email protected]>
@js3110
Copy link
Collaborator Author

js3110 commented Nov 8, 2024

Hey, looks fine, I have just a minor issue regarding the naming of variables.

I can see that spellcheck and lintr CI are failing, but looking at the errors, I think it is due to lacking WORDLIST and some rules from .lintr on this branch. Rebasing to main or copying those files over should solve the issue, but might create some conflicts that might have to be solved before merging.

@m-kolomanski i tried to rebase but it doesn't seem to be working as it doesn't show me any conflicts it just changes the file to the main version. Are we not able to merge anyway despite the spellcheck fail?

@m-kolomanski
Copy link
Collaborator

@js3110 I have rebased the branch, I believe all checks should pass, when they do you are free to merge

@m-kolomanski m-kolomanski merged commit fdf0454 into main Nov 8, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Mean plots show CV%
4 participants