Error Detecting Locale when deploying shiny - r

When I try to deploy my shiny application, I go this error. I tried to setlocale but it didnt help. Why did I get this error, what should I do?
Uploading bundle for document: 2646593...Detecting system locale ... Error in curl::curl_fetch_memory(url, handle = handle) :
Send failure: Connection was reset
Calls: ... tryCatch -> tryCatchList -> tryCatchOne ->
In addition: Warning message:
Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw'
(Using default: en_US)
Timing stopped at: 0.09 0.17 25.96
Execution halted

It's a little difficult to tell where you're deploying to or what the function error might be (is this to shinyappa.io? RStudio Connect?)
Have you tried look into the warning message? Addressing the read.table error might help, either the formatting of the file being uploaded could be throwing an error or your application may not be able to properly locate it after deployment.
Check out this set of answers to a similar read.table error.

Related

Accessing SharePoint in R

My script happened to get errors with accessing SharePoint. It used to work.
sp_con = sp_connection("https://asdf.sharepoint.com/sites/staff",
credentialFile = "H:/SharePoint API/creds.yml", Office365 = T)
The error was
Error in sp_connection("https://asdf.sharepoint.com/sites/staff", :
Receiving access cookies failed.
In addition: Warning message:
In readLines(file) :
incomplete final line found on 'Y:/Operations/SharePoint API/creds.yml'
I googled the warning message and found solutions to fix it. But still got the access cookies error. Thanks in advance for any idea!

Got knit issue with R

my code is working but I can not knit that part,Quitting from lines 17-19 (Homework-template.Rmd)
Error in data.frame(Davis$weight) : ÕÒ²»µ½¶ÔÏó'Davis'
Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> data.frame
´ËÍâ: Warning message:
In has_crop_tools() :
Tool(s) not installed or not in PATH: pdfcrop, ghostcript
-> As a result, figure cropping will be disabled.
Agreed with #T.G., indeed. you need to provide a MWE for us to see what is going on. We can't help you without, as much as we'd like to - sorry.
This said, from the little we can see, you are experiencing 2 separate issues: 1 which causes your code to fail: Error in data.frame(Davis$weight): some error with your data.frame as indicated in the error message and 1 which is just a warning, your markdown file should still compile just fine: Warning message: In has_crop_tools() : Tool(s) not installed or not in PATH: pdfcrop, ghostcript -> As a result, figure cropping will be disabled.
This warning message is how I landed on your post, looking for a solution myself... It stems from lines 315 onwards in https://github.com/rstudio/rmarkdown/blob/master/R/util.R. Here is how I "solved" this warning message under Windows, inspired by this GitHub issue thread:
Run tinytex::tlmgr_install("pdfcrop")
Install Ghostscript from this link
Run Sys.setenv(R_GSCMD="C:/Program Files/gs/gs9.53.3/bin/gswin64.exe") (adjust the version number as needed)
If you want to check: Sys.getenv("R_GSCMD") or tools::find_gs_cmd()
Should show what you just typed: "C:/Program Files/gs/gs9.53.3/bin/gswin64.exe" which is the correct path in my case.
Knit your file again - no more warning message.

How to fix Error cannot open connection on Ubuntu machine?

This might be a very trivial issue with R-related Ubuntu settings, but I'm pretty new to it and have no clue to solve this issue.
I'm trying to load a file from URL on a linux Ubuntu machine into R (R-Studio) with different strategies:
load(url("http://www.yaj.ch/data/test.rda"))
read.csv(url("http://www.yaj.ch/data/test.csv"))
readstata13::read.dta13("http://www.yaj.ch/data/test.dta")
data.table::fread("http://www.yaj.ch/data/test.csv")
but they all fail with similar error messages:
Error in load(url("http://www.yaj.ch/data/test.rda")) :
cannot open the connection to 'http://www.yaj.ch/data/test.rda'
In addition: Warning message:
In load(url("http://www.yaj.ch/data/test.rda")) :
cannot open URL 'http://www.yaj.ch/data/test.rda': HTTP status was '403 Forbidden'
that of fread is somewhat different:
trying URL 'http://www.yaj.ch/data/test.csv'
Error in download.file(input, tmpFile, method = method, mode = "wb", quiet =
!showProgress) :
cannot open URL 'http://www.yaj.ch/data/test.csv'
In addition: Warning message:
In download.file(input, tmpFile, method = method, mode = "wb", quiet =
!showProgress) :
cannot open URL 'http://www.yaj.ch/data/test.csv': HTTP status was '403 Forbidden'
This is what I got when I was mobile:
Error in load(url("http://www.yaj.ch/data/test.rda")) :
cannot open the connection to 'http://www.yaj.ch/data/test.rda'
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> load
Execution halted
When I Shift-click on the link in the script, the data opens in the browser, so the connection seems to be okay.
On my Windows machine everything works fine. So I guessed the issue is related to Ubuntu, as if R has connection problems or wrong access rights. But I'm not sure, since strangely enough e.g. this one opens in Ubuntu:
load(url("http://www.rdatamining.com/data/graph.rdata?attredirects=0&d=1"))
This solution wasn't helpful to me, and Google won't tell me anything either.
Is there any help?

RStudio v1.1.456 Rpubs upload error, no login prompt

Hi I couldn't find any useful information in regards to this one.
When I try to publish to Rpubs on Rstudio v1.1.456, instead of login prompt I get this error message below.
[Edited] Rstudio v1.1.456, R v3.5.1
Upload Error Occurred Error in if (result$status == 201) succeeded <-
TRUE : missing value where TRUE/FALSE needed Calls: In
addition: Warning message: In http(protocol, "api.rpubs.com", port,
method, path, headers, : NAs introduced by coercion Execution
halted
I've already addded this line
options(rpubs.upload.method = "internal")
to both global and working directory Rprofile
Apparently, there was an issue in the most recent version of rsconnect (0.8.12).
devtools::install_github("rstudio/rsconnect", ref = "bugfix/multi-status-header")
Installing the patch solves it.

Unable to Knit HTML /PDF/Word in R Studio(Version 0.98.1103). Encountering "Execution Halted"

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.

Resources