Use Graphics Magick in Modulus - meteor

I have deployed my meteor app on Modulus.io. My app requires Graphics Magic but how can I download/install GM on moudulus?
Do I have to Require something like Graphics magick in my code or do I have to install it on the server?

Related

How to package R shiny app in electron with included Rcpp code

I am trying to package a shiny app as a standalone application using electron as per: https://github.com/ColumbusCollaboratory/electron-quick-start
A portable R instance is used and electron calls it to create the shiny app. I need to do this as the app I am building is for someone who doesn't have R installed and doesn't want it installed. This works great until I try to 'sourceCpp' files written in Rcpp. I get the error:
Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir
= cacheDir, :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please install Command Line Tools for XCode (or equivalent).
I'm guessing this is because they can't find the c-compiler to compile the attached R-codes.
These are my questions:
How do I go about setting up a c-compiler with the portable-R session to compile these codes in a self contained programme (so I don't need the host to have a c-compiler already)?
Is it possible to call Rcpp functions which are already compiled so that no compiler is required?
If I were to make the Rcpp functions into a library would they require compilation by the user still?
I totally understand that this question may be complete nonsense and poorly worded. I'm a little out of my depth here and any advice is more than welcome.
Thank you for any help/pointers you can provide

gganimate within Shiny app - cannot find ImageMagick

I would like to insert animation plot in my Shiny app published on the server. However, any try of deploying ends up in the following:
I cannot find ImageMagick with convert = 'convert'
Warning in im.convert(img.files, output = path.expand(movie.name), convert =
convert, :
Please install ImageMagick first or put its bin path into the system PATH variable
Of course, there is no problem when I run the application on my computer with installed imageMagick. So my question is how can I force Shiny server to use the imageMagick from my computer or install it in Shiny environment?
You may want to check out the magick library:
See the vignette for an example making explicit reference to using magick with gganimate:
https://cran.r-project.org/web/packages/magick/vignettes/intro.html#animation
On GitHub, There is also an example map showing successful use of magick on Shinyapps.io:
https://github.com/jeroen/shinymagick

Disabling package install feature from R GUI and RStudio

We have our R and RStudio Desktop running on individual users Windows 7 desktops and all the users are getting the required packages from our local R package repository. No, i am trying to see if there is a way to block users from access to external CRAN repository mirrors.
Editing "C:\Program Files\R\R-3.3.2\etc\repositories" files and making CRAN point to our local repository URL is helpful but this will only work as long as users are not trying to exercise R GUI Packages-> install packages or set CRAN mirrors options.(CRAN variable is getting over ridden as and when R GUI options are exercised. )
This is the reason i am truing to see if there is a way to disable R GUI and/ or R Studio Package install GUI options?
I didnt find any help how to do it on R GUI without modifying the source code, but RStudio seem to have an environment variable which is supposed to disable this option but is not working for me.
As per this link setting "RSTUDIO_DISABLE_PACKAGES" environment variable should do the trick but setting this variable to 1 on below locations doesnt do anything.
C:\Program Files\R\R-3.3.2\etc\Renviron.site
C:\Program Files\R\R-3.3.2\etc\x64.Renviron.x64
Also, I found below text on RStudio admin guide but don't know what are the equivalent files and folders for windows environment and whether or not this is applicable to RStudio desktop
/etc/rstudio/rsession.conf
allow-package-installation=0

Setting Proxy in R and windows for Leaflet Package

I usually don't have trouble downloading packages and using them currently in my office but I do have trouble accessing some API's and using Leaflet (map does not render)
these things work while I am off the network but I wish to use my works proxy which I have the IP and user/pass but Can't get it to work on Windows.
So far I have tried the following with no success:
Sys.setenv(http_proxy="http://user#ip:8080/")
Sys.getenv("http_proxy")
This returns the proxy but does not allow leaflet maps to render still.
I managed to get this proxy to work in Python when installing packages with the following in the Terminal:
pip install mpld3 --proxy=http://user#ip:8080
Any help is appreciated.
Try the following:
setInternet2(FALSE)

How to generate rmarkdown report in Shiny as a desktop application

according to:
Locally installed Shiny app
I developed a Shiny application which can be distributed as a folder with a runscript and R-portable inside.
Now I implemented an export button in the shiny app, which generates a pdf file through rmarkdown. Running the shiny app from rstudio works.
But running the app in the folder with runscript, the pdf export does not work.
I think I also need RStudio portable and miktex portable inside the folder, but I do not know how to link the render function in rmarkdown package to this RStudio and how does RStudio know where the miktex executable is?
I can not install RStudio and miktex locally on the other machines, so I have to distribute it with the Shiny app.
Thanks for helpful comments.
I found the solution for the problem.
I copied the pandoc folder from RStudio and miktex portable into the main folder of my desktop app.
Second, I wrote the following into the RProfile.site in R-Portable (RPortable/App/R-Portable/etc/RProfile.site):
Sys.setenv(PATH=paste("C:/Program Files/Java/jdk1.8.0_05/jre/bin/server",sep=";","../pandoc/","../miktex/miktex/bin/"))
Now it runs on different machines. Only the Java path has to be changed eventually on another machine.
Bests

Resources