-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/DIMS_Excel_plots #92
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
base: develop
Are you sure you want to change the base?
Conversation
…styler and linter
rernst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ziet er goed uit, ik denk dat je naamgeving soms wat duidelijker/simpeler kan maken. Verder zit er nog een stukje code duplicatie in wat je volgens mij bij de create_boxplot_excel functie kan toevoegen.
| #' @param hmdb_id: HMDB ID of the selected metabolite | ||
| #' | ||
| #' @returns boxplot_excel: ggplot2 object containing the plot of intensities | ||
| create_boxplot_excel <- function(intensities_plots_df_long, hmdb_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ook hier zo ik van maken: create_boxplot. Excel toevoegingen zijn niet echt nodig omdat het een functie is van de generate_excel_functions.R. Eventueel zou je hem 'private' kunnen maken. In python zou je dan doen: _create_boxplot -> dat geeft aan dat het niet de bedoeling is om de functie buiten de context van deze file te gebruiken. Weet niet of dat een ding is in de R 'wereld'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik heb de functie naam aangepast. Volgens mij kan je in R niks 'private' maken. Ik kon alleen iets vinden over internal functions, maar dat heeft weer met packages te maken. De functie create_boxplot wordt nu, na andere aanpassingen, alleen in de generate_excel_functions.R gebruikt.
DIMS/GenerateExcel.R
Outdated
| plot.new() | ||
| tmp_png_helix <- paste0("plots/plot_helix_", hmdb_id, ".png") | ||
| png(filename = tmp_png_helix, width = plot_width, height = 300) | ||
|
|
||
| boxplot_excel_helix <- create_boxplot_excel(intensities_plots_df_long, hmdb_id) | ||
|
|
||
| print(boxplot_excel_helix) | ||
| dev.off() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zou dit ook niet in de 'create_boxplot_excel' functie passen? Het lijkt er nu op de het maken van de boxplot feitelijk nog hier gebeurd, create boxplot genereerd nu enkel de ggplot config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze code is iets anders dan het maken van een boxplot. Om de plot in de Excel te plaatsen moet je de plot als png opslaan om daarna deze met de insertImage() functie in de Excel te zetten. Ik heb deze code plus de insertImage() code verplaatst naar een nieuwe save_plot_to_excel_workbook functie.
Uh oh!
There was an error while loading. Please reload this page.