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

R markdown report not generating from shiny app #10

Open
AmyMikhail opened this issue Mar 9, 2021 · 4 comments
Open

R markdown report not generating from shiny app #10

AmyMikhail opened this issue Mar 9, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@AmyMikhail
Copy link
Collaborator

Problem statement:

The shiny app launches, but when clicking the generate report button it only produces a copy of the inputs. The r markdown report is not generated.

@AmyMikhail AmyMikhail added the bug Something isn't working label Mar 9, 2021
@AmyMikhail AmyMikhail self-assigned this Mar 9, 2021
@PaulC91
Copy link
Collaborator

PaulC91 commented Mar 9, 2021

Hi Amy.

This will be due to an id mis-match on the download handler between the UI and the server. outputId = "rapport" in the UI and output$report in the server.

A mistake I have made many times!

Best,
Paul

@AmyMikhail
Copy link
Collaborator Author

Thanks @PaulC91 - after correcting this I have another error though with regards to the filepath to the temporary file:

Warning in normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\AMikhail\AppData\Local\Temp\Rtmp4KKxBw/ELISAQCrapport.Rmd": The system cannot find the file specified
Warning: Error in abs_path: The file 'C:\Users\AMikhail\AppData\Local\Temp\Rtmp4KKxBw/ELISAQCrapport.Rmd' does not exist.
  [No stack trace available]

Any ideas?

@PaulC91
Copy link
Collaborator

PaulC91 commented Mar 9, 2021

hm not sure why the temp file isn't being recognised, but it's not strictly necessary so maybe try passing just "ELISAQCrapport.Rmd" as the input to rmarkdown::render.

Another thing I just noticed is that the output_file argument of the render function needs to be file in this case which is passed as the argument of the content function in the download handler. So try:

rmarkdown::render(input = "ELISAQCrapport.Rmd", 
                  output_file = file,
                  params = params,
                  envir = new.env(parent = globalenv()))

@AmyMikhail
Copy link
Collaborator Author

It is strange but when I tried removing the temp file creation and saving the file in exactly the same place as the .Rmd is, it still can´t find it:

Warning in normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="ELISAQCrapport.RMD": The system cannot find the file specified
Warning: Error in abs_path: The file 'ELISAQCrapport.RMD' does not exist.
  [No stack trace available]

I get this error even if I avoid changing the name of the .html output - not sure why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants