Unable to locate package RCurl - R in Streamlit - r

Guys, I'm having problems deploying my streamlit application, I include the RCurl package in the packages.txt list, however the deploy is interrupted with the following message:
unable to locate package RCurl
Another interesting thing:
The first time I deployed, RCurl was not included, and my application ran normally.
However when I performed a second deployment of the same application, when executing a function dependent on this package it returned "there is no package called RCurl"
Importantly, this same function was performed on the first deploy.
From then on I tried both ways:
listing the RCurl in packages.txt, and
not listing RCurl in packages.txt
in the first form the deploy is completed but when executing the function the following message is returned "there is no package called RCurl"
and when trying the second way the deploy is interrupted with the following message: 'Unable to locate package RCurl'
Can anyone give me a hint of a possible solution?
Thanks!

Related

sharing shiny app with renv throws error due to bslib

I wanted to make internally sharing/locally launching a shiny app developed with the {golem} framework a little more robust.
Hence, I used the renv package and installed the shiny app as a local package into a project folder.
I proceeded as follows (thanks #Kat for the suggestion):
initialize renv using renv::init(bare = TRUE)
renv::install("my_local_package")
renv::snapshot(type = "all")
renv::isolate()
Writing a launch file consisting of:
library(golempackage)
renv::restore()
golempackage::run_app(options = list(launch.browser = TRUE))
Share folder.
However, when launching the shiny app on a different computer (or a docker testing environment), I get the following error caused by the package bslib. Same happens when I delete my cache:
An error has occurred!
File attachments must exist: 'C:/Users/XYZ/AppData/Local/R/cache/R/renv/cache/v5/.../bslib/lib/bs3/assets/fonts'
Note: this error even occurs if I set the cache to be project-local and share it inside the project folder.
However, now the error message does not reference the global but the project-local cache. Unfortunately still as an absolute path which throws an error for other users.
This is all super weird and I have not the slightest idea why this occurs.
I would like to avoid removing bslib.
As far as I can see, the error is coming from the sass package, e.g.
https://github.com/rstudio/sass/blob/f7a954027447dd0b9826ec01c7084c89a6e64fcc/R/layers.R#L442-L443
While I don't know exactly know what's going on, you could probably use the R debugger to check why that's failing. (Does the referenced folder exist in both cases? Are you expecting renv to be using the cache in the second case?)

Why is R library not loading in app.powerbi.com?

I keep getting the following error on app.powerbi.com:
"Error in pivot_wider(data, names_from=names,values_from=values): could not find function "pivot_wider""
I load the 'tidyr' package as a required library.
I get the same error when using "spread" instead of pivot_wider.
When I specify the function using:
tidyr::pivot_wider(data, names_from=names, values_from=values)
I get a different error:
"Error in loadNamespace(name): there is no package called 'tidyr'".
PowerBI Desktop everything works perfectly fine. It's only on the published PowerBI report that I get the error.
What can I do to resolve this issue?
Alternative library / function to 'pivot_wider' or 'spread'?
I was able to verify using print statements that the report on powerbi.com was not able to access the r packages that were installed.
I was using a .libPaths()[3] to point to the location where my libraries were installed, but this didn't work in powerbi.com.
I ended up re-installing R to a location where I could install packages to, since admin rights are necessary to write to the C:/users/program files location.

how can fix this issue "Error in h2o.upload_model() : could not find function "h2o.upload_model"?

I have installed h2o package(in R from RStudio console). Post h2o.init() I am trying to use the built in function upload_model()/upload_mojo() but I am getting following error.
h2o.upload_mojo()
Error in h2o.upload_mojo() : could not find function "h2o.upload_mojo"
h2o.upload_model()
Error in h2o.upload_model() : could not find function "h2o.upload_model"
I found work around to resolve this issue. Please find below the steps I followed:
Remove the package using: remove.packages("h2o")
Quit the current session and launch the new one.
Move out lock file for h2o from path where package was installed mostly under R with file name like - 00LOCK-h2o
Install new/latest version of package via RStudio console using install.packages()
It should now resolve this issue.

Getting: "Failed to fetch metadata" when starting up Jupyter

I am using JupyterLab as my IDE and I have a couple of packages installed. Namely, the 'jupyterlab-dash' and 'juptyerlab-plotly' packages. My issue is when I go to launch 'juptyer lab' from terminal, I notice the following error:
Failed to fetch package metadata for 'jupyterlab-dash': URLError(gaierror(8, 'nodename nor servname provided, or not known'))
I'm not sure why this error is popping up but I've noticed this error only pops up when I have no internet connection (working on a train etc.). Could it be because these packages are trying to call something as I launch and because I don't have an internet connection it raises the error?
In the end I am able to use JupyterLab and the packages as intended (at-least it seems), but I'm curious why this error to 'fetch metadata' appears?
Thanks,

R packages inaccessible via "opencpu knitr app"

I started playing with OpenCPU a couple of weeks back and am getting hooked to it. I was able to succesfully install the "knitr" and "opencpu.demo" apps. The issue I am running into is when I try to invoke the R functions I packaged under a new r package and call it from within knitr-app. I get a message saying no such package exists. I ran installed.packages(lib.loc="/usr/lib/R/library") from an R shell and from knitr-app interface and indeed my packages shows up in the former but not in the latter case. No idea whats going on here ! Will greatly appreciate if anyone can answer this.
omments:
when i run find.package("DummyPkg") through the /R/pub/base/identity/json API , I do get back
[
"/usr/lib/R/library/DummyPkg"
]
However the same query from within knitr-app webpage returns:
# write R code here
find.package("DummyPkg")
## Error: there is no package called 'DummyPkg'
The default html page for knitr app has links to opencpu.org server, so the POST was going to public server instead of going to my server, no wonder my packages weren't showing up !
Comments:
when i run find.package("DummyPkg") through the /R/pub/base/identity/json API , I do get back
[
"/usr/lib/R/library/DummyPkg"
]
However the same query from within knitr-app webpage returns:

Resources