Issues installing Plotly Dash for R - r

I'm trying to install the newly released Plotly Dash package for R as described on plotly website https://dashr.plot.ly/installation, i.e. running
library(devtools) # devtools: Tools to Make Developing R Packages Easier
# The following statement will also install dashCoreComponents,
# dashHtmlComponents, and dashTable
install_github('plotly/dashR') # The core dash backend
This is what it returns, 'unknown package' any help much appreciated
Error: Failed to install 'unknown package' from GitHub:
HTTP error 403.
API rate limit exceeded for 86.134.113.102. (But here's the good news:
Authenticated requests get a higher rate limit. Check out the
documentation for more details.)

Just installed the package to reproduce the error, unfortunately can't be able to reproduce it. However, a potential solution along "error 403 and
API rate limit exceeded ..." could be to add your github authorization token in your .Rprofile and that is what the "But here's the good news:" message inside the bracket is trying to inform you. Have a look at the actual project github site Dash for R if you haven't already. That might as well provide you an input to solving the issue.

Related

R CRAN submission - URLs check

I can not find how to replicate the internal CRAN test for the URLs healthy.
It is important that this test is run only on the Debian winbuilder (yes, debian under winbuilder). As this test is not run on the Windows machine so we could NOT use the https://win-builder.r-project.org/upload.aspx website service to replicate it.
The example error message from the CRAN server, as the website was moved.
Such message is producing the NOTE so the package is not automatically processed.
Found the following (possibly) invalid URLs:
URL: http://blog.obeautifulcode.com/R/How-R-Searches-And-Finds-Stuff/
From: inst/doc/tinyverse.html
Status: Error
Message: Could not resolve host: blog.obeautifulcode.com
Edit:
There is a useful source with CRAN policy in this area https://cran.r-project.org/web/packages/URL_checks.html
(Promoting comment to answer as suggested...)
The test code has been pulled out of R itself and made into a package you can install. Other than that it is of course part of any (recent enough) R or R-devel build.
FWIW I also wrapped this into a convenience script I call all the time on my systems.

Failed to install 'unknown package' from GitHub

I am trying to install the ggpattern package from GitHub (https://www.rdocumentation.org/packages/ggpattern/versions/0.2.0)
I've reinstalled R, followed the all steps according to the site, also tried
remotes::install_github("coolbutuseless/ggpattern", force = TRUE)
But I still get:
Error: Failed to install 'unknown package' from GitHub:
HTTP error 401.
Bad credentials
Rate limit remaining: 19/60
Rate limit reset at: 2022-01-29 18:28:15 UTC
I'm working on R version 4.1.2 (newest according to me) on Windows.
Do you have any idea what is the issue here?
You need to check if you have a personal access token set in your environment. For example, when I have a Git project, I set a personal access token. However, I set this in the project environment, so that it isn't any issues outside of that environment.
To see if there is one assigned:
Sys.getenv("GITHUB_PAT")
If there is one set, write it down (you may need that in the future).
To remove it, so you can install the GitHub package:
Sys.unsetenv("GITHUB_PAT")

Error using map function in edgarWebR 1.1.0

I wrote a script for downloading and analyzing 13F filing from a select number of fund managers using the great package edgarWebR in R. Unfortunately the script stopped working after my update to version 1.1.0 of edgarWebR. I get the following error message whilst running this part of the script:
map(filings_incl_href$href, filing_details)
filings_incl_href$href contains the hrefs of all the fund managers 13F-filings, e.g. the first one is: https://www.sec.gov/Archives/edgar/data/1540531/000154053121000004/0001540531-21-000004-index.htm
Here's the error message:
No encoding supplied: defaulting to UTF-8.
Error in check_result(res) :
EDGAR request blocked from Undeclared Automated Tool.
Please visit https://www.sec.gov/developer for best practices.
See https://mwaldstein.github.io/edgarWebR/index.html#ethical-use--fair-access for your responsibilities
Consider also setting the environment variable 'EDGARWEBR_USER_AGENT
Not sure what is causing this. Any help would be greatly appreciated.

install_github results in an api rate limit error regardless of which package is installed

install_github results in an api rate limit error regardless of which package is installed. Here is the error:
WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools 3.5 from http://cran.r-project.org/bin/windows/Rtools/.
Error: Failed to install 'unknown package' from GitHub:
HTTP error 403.
API rate limit exceeded for 206.214.41.90. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
Rate limit remaining: 0/60
Rate limit reset at: 2019-09-20 17:45:53 UTC
To increase your GitHub API rate limit
- Use `usethis::browse_github_pat()` to create a Personal Access Token.
- Use `usethis::edit_r_environ()` and add the token as `GITHUB_PAT`.
This post touches on my issue but I'm not installing from a local source so the solution wont work ("API rate limit exceeded" when trying to install local R package using devtools::install()).
And just to be clear, I haven't accessed github in anyway from my internet connection in months. Whats the source of the error and does anyone know of a way to install packages from github that doesnt rely on a request via their api?

install.keras() in RStudio fails with http connection error

I've been trying to install and run keras in RStudio (Windows) in vain.
i installed keras package using normal package "keras"
(didn't use github)
I've installed latest python (3.6) and Anaconda.
then i use
> library(keras)
> install.keras()
and i get this error:
Creating r-tensorflow conda environment for TensorFlow installation...
Fetching package metadata ... CondaHTTPError: HTTP 000 CONNECTION
FAILED for url
https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2
Elapsed: -
An HTTP error occurred when trying to retrieve this URL. HTTP errors
are often intermittent, and a simple retry will get you on your way.
ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='repo.continuum.io',
port=443): Max retries exceeded with url:
/pkgs/main/win-64/repodata.json.bz2 (Caused by
ConnectTimeoutError(, 'Connection to repo.continuum.io timed out.
(connect timeout=9.15)'))",),)
Error: Error 1 occurred creating conda environment r-tensorflow In
addition: Warning message: running command
'"C:\PROGRA~3\ANACON~1\Scripts\conda.exe" "create" "--yes" "--name"
"r-tensorflow" "python=3.6"' had status 1
I've looked up everywhere on the web and can't figure out how to install keras and tensorflow properly. Using latest version of R (3.4.2)
Every method fails somewhere.
just to add to misery, i've also tried:
> devtools::install_github("rstudio/keras")
and i get this error:
Installation failed: Timeout was reached: Connection timed out after
10015 milliseconds
I am not behind any authenticated proxies. So, after multiple failure, i just downloaded the zip file from github and manually installed it using the zip file.
i also tried install.packages("keras") and that didn't give me any error either.
when i call the library i don't get any errors (as shown above)
UPDATE: I was able to install and use the package very easily on another computer that doesn't have python/anaconda installed on it already.
UPDATE 2: my proxy does not need authentication and there is no https_proxy either.
OK,, FINALLY found a solution.
Turns out RStudio uses a lot of default proxy settings, so i needed to change all that and set up my own proxy settings.
First step:
Rstudio --> Tools --> Global Options --> packages --> uncheck both "Use secure download method for HTTP" and "Use Internet Explorer librayr/proxy for HTTP"
Second step, in RStudio type:
> file.edit('./.Renviron')
Either an empty file or some file with already existing proxy settings will open. (Mine was empty). Then I included the following two:
http_proxy=http://myusename:password#proxy.server.com:port/
https_proxy=http://myusename:password#proxy.server.com:port/
(a few notes: I didn't have a https_proxy setting but I still needed to use the http_proxy details for my https_proxy setting. This was one of the culprits for my issue. Also, I needed to include the username:password even though my proxy doesn't need secure authentication. Same thing goes with the port. Port number had to be included, otherwise it wouldn't work.
Step 3:
Saved the new changes in .Renviron file and restarted RStudio.
I checked my proxy settings in RStudio after restart by typing:
> Sys.getenv("http_proxy")
> Sys.getenv("https_proxy")
The first few times i did this i realised that the proxy settings were not being changed in RStudio because i was editing the wrong .Renviron file. So, it's best to use file.edit('~/.Renviron') in step 2 to make sure it's the right file.
After all this, when i ran install.keras(), it installed successfully, including installing Tensorflow. Again, initially i had skipped step 1 so keras started being installed but it failed at installing tensorflow.
It was only going through all the steps that i was able to install both keras and tensorflow successfully over a proxy. Hope this helps.
Uninstalling Anaconda3 and installing Anaconda2 (i.e. Python 2.7) did the trick for me: https://www.anaconda.com/download/

Resources