I am fairly new to R shiny app development. My current app allows users to load data and fit fish tag return models via maximum likelihood. I use the package TMB to
- compile a C++ .cpp file (function compile)
- load the .DLL using the dyn.load(dynlib("DLLName"))
- use the TMB MakeADFun function to create the necessary gradient information
fitmodel<-MakeADFun(datar,parameters,DLL="IRCR",silent=T) - fit the model using nlminb
fit<-try(nlminb(fitmodel$par,fitmodel$fn,fitmodel$gr,control=list(eval.max=100000,iter.max=mit),
lower=c(rep(log(flow1),length(Fyr)),rep(log(mlow1),length(Myr)),rep(log(falow1),length(FAyr))), upper=c(rep(log(fupper1),length(Fyr)),rep(log(mupper1),length(Myr)),rep(log(faupper1),length(FAyr)))),silent=T)
Everthing works fine locally.
When I deployed the app to the Shinyappio, I thought I could just include the .DLL in the "/www" folder (and not have to recompile) and access it with dyn.load when needed. However, my app keeps crashing when I go to run a model . I tried a couple of things initially thinking the dyn.load couldn't find the path. But now I don't think that is the problem
Does anyone know if I can actually include a DLL in the deployment? Or would I have to compile it differently? Any help will be greatly appreciated.