How to include a compiled object in an R shiny app


I have some compiled code as part of calculations. My shiny app that contains that works fine from my Rstudio. However, it does not run on

Is there a way to bring that in, please?


Depending on the language your compiled code, one easy option would be to use Rcpp to "translate" your code to R, provided your code can be easily rewritten as C++. Would that be a live option for you?

Thank you so much for your quick and informative answer!

I'm actually using Fortran.

I think it might be an issue with the .dll file instead of an .so file, since shinyapps runs from Linux. I'm trying to put together the app and program from WSL2 and see if that works.

Thanks again,

That was exactly the issue. I did an "R CMD SHLIB" in the WSL2 to produce an .so file.
Then I updated the app.R to load the .so instead of .dll.
Everything works well.


1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.