ggPMXdevelopment / ggPMX

ggPMX R package
37 stars 12 forks source link

Loss of the markdown code during report customization #111

Closed MorganePhilipp closed 3 years ago

MorganePhilipp commented 4 years ago

Bug description I modify the standard ggpmx markdown code in order to customize my report and add plots. To do so, I create a new folder that I call 'GGPMX', I copy the standard ggpmx markdown that I rename 'ggPMX_report.Rdm' and then I modify it. When I launch the R code below to generate the ggPMX report, my markdown code just disappear and I get this error message: _Error in pmx_draft(contr, name, template, edit) : !Template .../GGPMX/ggPMXreport.Rmd DO NOT EXIST

How this issue can be fixed ?

R code use

------------- ggPMX controller --------------
Set-up the Monolix output directory

work_dir = 'xxx' dir = 'xxx' inp = "xxx"

Set-up working directory

setwd(work_dir)

Create controller

ctr = pmx_mlx(config = "standing", directory = dir, input = inp, dv = 'DV', time = 'TIM', dvid = 'DVID', cats = c('SEX'), conts = c('WT0'))

------------- ggPMX report customization --------------
File Name for ggPMX report

report_name = "ggPMX_report"

Report creation

ctr %>% pmx_report(name = report_name, save_dir = '.../GGPMX', format = "both", footnote = TRUE, extension = c("pdf","word"), template = '.../GGPMX/ggPMX_report.Rmd')

Screenshots GGPMX_issue GGPMX_issue2

MorganePhilipp commented 4 years ago

To fix this issue, we find out with @biethbr1 two solutions:

  1. If the user want to create the report in the folder where the markdown code is located, the two files have to be named differently.

Example:

File Name for ggPMX report

report_name = "ggPMX_report_project"

Report creation

ctr %>% pmx_report(name = report_name, save_dir = '.../GGPMX', format = "both", footnote = TRUE, extension = c("pdf","word"), template = '.../GGPMX/ggPMX_report.Rmd')

  1. The other way is to generate the report in a new folder so there is no problem of name.

Example:

File Name for ggPMX report

report_name = "ggPMX_report"

Report creation

ctr %>% pmx_report(name = report_name, save_dir = '.../GGPMX2', format = "both", footnote = TRUE, extension = c("pdf","word"), template = '.../GGPMX/ggPMX_report.Rmd')