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
Related
When I launch R-based Jupyter Notebooks in Visual Studio Code, I want each R notebook to have its working directory set to the directory the file sits in. However, this is not happening (details below).
Various iterations of this question have been asked, but the solutions seem to work only for Python-based Jupyter notebooks in Visual Studio code. For those, the solution is simply to update the VS Code settings to set Notebook File Root to ${fileDirname}:
That works perfectly fine for my Python code. However, it does not work for R-based Jupyter notebooks in Visual Studio Code on macOS. More specifically, I find that the first R notebook launches with its own folder set as the working directory, as expected. But subsequent R notebooks launch in the same folder as the first R notebook that I launch. (Unlike Python notebooks, which again open just as expected.)
Has anyone gotten R notebooks to open in their expected directory in VS Code (version 1.74.0)?
I've created a new package project with RStudio but when I open .R files the source pane remains empty.
The tab shows that the file name is being registered, but none of the script appears.
When I open the hello.R file in a 'normal' project the contents of hello.R appear as expected.
I have tried reinstalling both R and RStudio and checked that windows 10 is up to date.
I'm using R version 4.2.0, RStudio 2022.02.2 Build 485, Rtools42 on a windows 10 OS
The same is true for a previous local package I have developed which I can no longer edit. The existing package works fine but when I open the .R files non of the code is displayed.
I'm hoping someone may have some ideas to resolve this or where to look to try to problem solve this.
My work round is to use a previous version of R: 4.1.3 in which case the scripts appear as expected in the source window.
Package project console
'Normal' project console
After opening a .R file in Pycharm and trying to run the R code, the error R Console Failure: Cannot run console until path to viable R interpreter is specified appears. The R language plugin is installed, as is R for the computer, but PyCharm File -Settings -Languages and Frameworks does not show R (screenshot ). RStudio runs the R code in the file without problems. PyCharm used to run it, but after closing and reopening PyCharm, the file no longer runs.
I did the Edit Configurations that PyCharm asked and specified a .R configuration: the file is my open file that I want to run, the file directory is the working directory.
The file in question is an existing file initially created in RStudio. It is not a PyCharm project.
Ubuntu 18.04 on Dell Latitude E 7470.
Restarting PyCharm worked for me.
I was working on a Python project. Then I decided to change to an R project, opened it, and then opened some R files in PyCharm. That's when the error appeared.
I restarted PyCharm and upon reopening it, the R files were all there and the R console was working.
I just encountered a similar problem. I think the issue was that when I created the project in Pycharm. I did not initially choose to create the project as an R Project or R Package. Not sure if it's possibly to work around this if the project was initially designed with Python.
Copying the R file to a folder with a previously working PyCharm project (with a main.R file) and then opening it in PyCharm, the code in the file ran. The problem was solved, but it reappeared after the computer went to sleep and was wakened.
The file in the folder of the working PyCharm project no longer ran, but generated the original error. Closing the file in PyCharm and reopening did not work. Closing PyCharm and then doubleclicking the file to open it and PyCharm together worked: the code in the file ran.
I'm currently running into an issue of a .Rmd file opening in RStudio without actually populating the Source pane with the code. The file was written in RStudio, and the code shows up when I open the file in Notepad (and copies with the right formatting), but there's nothing showing up inside of RStudio.
Has anyone run into this issue before or have a good fix?
I had this same challenge too. I had to install Rstudio directly from CRAN and it works now, this issue probably happens with R studio installed via Anaconda.
I need to make multiple Shiny apps, exceeding my 5 app allowance in the free version of shiny.io. So I am trying to use RInno. I know this is ridiculous, but the beginner's tutorial for RInno seems too sparse for me (they do call it a 'minimal example'). I simply cannot figure out what I am meant to do. In the tutorial, a pre-loaded 'example' app is used to demonstrate.
# If you don't have development tools, install them
install.packages("devtools"); require(devtools)
# Use install_github to get RInno
devtools::install_github("ficonsulting/RInno", build_vignettes = TRUE)
# Require Package
require(RInno)
# Use RInno to get Inno Setup
RInno::install_inno()
# Example app included with RInno package
example_app(wd = getwd())
# Build an installer
create_app(app_name = "Your appname", app_dir = "app")
compile_iss()
When I run this in RStudio, a folder called app appears in my working directory. I open it to find the following (screen shot):
What do I do now? I have tried opening 'Your appname' and following the set up instructions (clicking next>next>next>>>finish). This puts a short cut called 'Your appname' on my desktop. I open this but get the error:
Am I doing something wrong? Is this a bug? Opening the html folder in the app folder from the first screen shot reveals a html of a plot that I presume is the example. This would suit me just fine for my own needs. However when I have tried to launch an existing app of my own with something like
create_app(app_name = "existing app", app_dir = "path/to/existing/app")
compile_iss()
Then I don't even get a html folder like the one in the screen shot here!
The script for my existing shiny app is in RStudio, is this right? Or does it need to be in Inno Setup Script?
Any pointers would be really great. Cheers