ggPMX icon indicating copy to clipboard operation
ggPMX copied to clipboard

Unable to load custom template with ggPMX 1.2.8

Open biencan1 opened this issue 3 years ago • 4 comments

Unable to load custom template to create report with ggPMX 1.2.8. Error message as follows:

image

Generated with ggPMX 1.2.8

Code

ctr %>% set_abbrev(
  IPRED ='Individual prediction (ug/mL)',
  PRED='Population prediction (ug/mL)',
  DV='Observed conc. (ug/mL)',
  TIME='Time after first dose (days)',
)

ctr %>% pmx_report(
  name="Rerun_Report_ggPMX",
  save_dir=model.dir,
  format="both",
  extensions=c("word", "pdf"),
  template=file.path(model.dir, "Standard_Report_ggPMX.Rmd")
)

biencan1 avatar Aug 25 '22 16:08 biencan1

I am having the same issue: image

Code

ctr %>% pmx_report(
  name="ggPMX",
  save_dir=mlx_dir,
  template=file.path("ggPMX0.Rmd")
)

tmss1 avatar Sep 05 '22 15:09 tmss1

  • confirm issue can be reproduced using a simple example:
pmx_report(
  contr=theophylline(),
  name="dummy",
  save_dir="/tmp/",
  template="/tmp/custom_report.Rmd"
)
  • which throws the following error
Error in draft(template_file, template = template_dir, create_dir = FALSE,  : 
  No template.yaml file found for template '/tmp/RtmpzatMrO/standing'
In addition: Warning message:
In file.create(to[okay]) :
  cannot create file '/tmp/RtmpzatMrO/standing/skeleton/skeleton.Rmd', reason 'No such file or directory'
  • will start working on debugging / fix

tynsci avatar Oct 17 '22 08:10 tynsci

  • it has been possible to identify the source of the problem:

    • a copy step is missing for inst/rmarkdown/templates/standing/template.yaml into the temporary directory used for report creation
  • merge request with fix forthcoming

tynsci avatar Oct 17 '22 09:10 tynsci

As of latest tests, when trying to use custom template, there was no error, but the report generated was using the default template (instead of the custom one).

baltcir1 avatar May 11 '23 13:05 baltcir1