I followed the steps outlined in https://blog.safaribooksonline.com/2014/01/29/rstudio-r-markdown-r-scripts-rpubs/
but encounter error as in Can't publish markdown to Rpub on Windows
Step 1:
install.packages('knitr', dependencies = TRUE)
Step 2:
library('knitr')
Step 3:
File-> New File-> R Markdown.
Key in Title, Author, and choose HTML radio button.
Some template appear..
Step 4:
Click knit HTML button
Step 5:
I create a free account by visiting www.rpubs.com.
Step 5:
Click Publish.
Once you click the publish button you will be prompted to login with your RPubs account. --> I do not have this...
But I have error:
"Error in function (type, msg, asError = TRUE) : SSL certificate problem: unable to get local issuer certificate Calls: rpubsUpload ... -> .postForm -> .Call -> -> fun Execution halted"
Boniface Osonwanne's answer at https://support.rstudio.com/hc/communities/public/questions/202496207-Difficulties-in-publishing-R-presentation-in-RPubs worked for me with a little tweaking.
To summarize, he said open up the following directory:
C:\Program Files\R\R-3.1.2\library\base\R
Then add the following line using Notepad on line 25.
options(rpubs.upload.method = "internal")
Notepad made a mess of the file for me, but Notepad++ worked fine.
My problem came in when I tried to save. Even though I had just rebooted and didn't have R or Rstudio open, I couldn't save. I copied the file to my desktop made the edit there and copied the file back with administrator permissions.
When I started R and knitted my Rmd, it worked like a charm.
Related
I'm trying to publish an R Shiny app. It works when run locally, but once published to shinyapps.io produces the following error.
Warning in gzfile(file, "wb") :
cannot open compressed file '/key.rda', probable reason 'Permission denied'
Error in value[[3L]](cond) : cannot open the connection
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
You can also see the actual page with the error here: https://povertylab.shinyapps.io/ACS-Map-Dashboard/
Though I have tried to reproduce this error it doesn't appear when I publish other apps, and my searches haven't turned up anything. Other things I've tried: publishing from other computers, publishing only global.R, server.R, and ui.R files, and copying files to a new project and publishing from there.
You can find all code for the app here: https://github.com/Poverty-Lab/ACS-Map-Dashboard
I would appreciate any input, even if it's just guidance on what gzfile is and what the error message could mean. Thank you!
Where is the key.rda file supposed to be? I've looked through your repo and I don't see it, which is probably causing the "cannot open the connection" error.
As a side note, you should probably ignore the .Renviron file; right now anyone can use see and use your key. Make sure you remove it from the history as well.
Thanks all. Turns out this was a problem with the way we were handing the api key for the acs package. We were using api.key.install to install the api key inside the app, and one of api.key.install's default arguments is file = "key.rda", and that file apparently could not be found. I'm still not sure why this problem only came up when we published the app, but we got around it by supplying the actual api key to the acs.fetch function in server.R.
I'm trying to publish an RMarkdown document to my RPubs account, but I get the next error when clicking on "Publish":
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'C:/Users/.../File.Rmd': No such file or directory
It also pops up a window saying the next two warnings:
First pop up: "Could not Publish - Error ocurred while executing method"
Second pop up: "Could not Publish - (TypeError): null is not an object evaluating 'b.g.')
My R version is 3.4.2, RStudio version is 1.1.383, knitr version is 1.17.
I have also checked is the working directory contains the files I'm using at the script, and all seems properly set.
This error only happens when I click on Publish. If I try to knit to HTML or to PDF it works. I have tried to restart and reinstall also both R and RStudio but the error persists.
Has anyone had the same error and knows how to solve it?
Thank you very much!
Is the file saved? Are you in the correct directory?
Please check getwd().
I managed to solve it. The problem was that the path of the working directory contained an accent. I changed the path to another folder without accents and it worked.
recently I wanted to enable the Showcase mode on my Shiny app, which I uploaded to shinyapps.io. I looked at some other questions in this forum and created a DESCRIPTION file (no file extension) that looks like this:
Title: XX
Author: YY
DisplayMode: Showcase
Type: Shiny
As soon as I want to upload my App together with the Description file (using either the "publish" button provided by RStuio or using the "shinyapps::deployApp("XX",account="yy")" command), I get the following error (99999 is an edited number):
Preparing to deploy application...DONE
Uploading bundle for application: 99999...Error in readDcf(file.path(project, > "DESCRIPTION"))[, "Package"] :
subscript out of bounds
Calls: ... suppressMessages -> withCallingHandlers -> -> unname
Execution halted
I also tried adding/removing lines from the DESCRIPTION file, including the DisplayMode line, but it didn't help. Uploading the App without the Description file still works fine. Furthermore I completely uninstalled R and RStudio and reinstalled the newest versions (3.2.3 and 0.99.879). I am using Windows 10.
Also the app works fine and is in Showcase mode if I run it locally.
Any ideas what this could be about?
Thank you so much in advance,
Laurin
I was working on R markdown documents in R studio, and I had knit the HTML, PDF and Word. It had worked fine.
Then when I tried to publish it online I encountered an error
" Error in function (type, msg, asError = TRUE) : SSL certificate problem: unable to get local issuer certificate Calls: rpubsUpload ... -> .postForm -> .Call -> -> fun Execution halted"
To solve which I had found a solution at " https://support.rstudio.com/hc/en-us/articles/205002917-SSL-certificate-problem-when-publishing-to-RPubs" which suggested running the command
file.edit('~/.Rprofile') within RStudio
and inserting the following code:
options(rpubs.upload.method = "internal" .
But after doing the above, I have not been able to knit any thing in R Studio.
Every time I click Knit button I keep encountering
"Error: could not find function "file.edit"
Execution halted"
How can I resolve this and get things to work?
I have finally found the solution. I simply found where my .Rprofile was and deleted it. It solved my problem.
After compile the R Markdown document with knitr package in html file, I tried to push to RPub with the "Publish" bottom. However, I am getting error as:
"Error in function (type, msg, asError = TRUE) :
SSL certificate problem: unable to get local issuer certificate
Calls: rpubsUpload ... -> .postForm -> .Call -> -> fun
Execution halted"
I am using windows RStudio Version 0.98.1091.I am assuming it is because windows to Rpub connection configuration issue.
First time using the Rpub. Could you help where to config the SSL certificate on windows? Thanks.
Under preferences in Rstudio, there is a tab "git/SVN".
Have you created an "RSA" key?
This can be done through github.
See https://help.github.com/articles/generating-ssh-keys/