Problems with R Request price feed through Bloomberg API - r

Following the steps as outlined below:
install Java APIv3 from the Bloomberg terminal (by typing WAPI into the command bar). Once installed connect it to R using :install.packages("Rbbg", repos = "http://r.findata.org") and conn <- blpConnect(log.level = "finest"). Finally, to extract share price information you use bdp(conn,securities,function)
I get an error when trying to connect that gives me the following message:
Error in .jnew("org/findata/blpwrapper/Connection", java.log.level) :
org.findata.blpwrapper.WrapperException: Session not started because: CONNECTION_FAILURE
Any advice how to resolve this would be very appreciated.

Please try migrating to Rblpapi. This is more modern equivalent and can be found on CRAN (install.packages("Rblpapi")) or github (https://github.com/Rblp/Rblpapi).

Related

How can I get past this 'SSL connect error' when using jsonlite::fromJSON in R?

Issue
I get the following error whenever I run
all_companies <- jsonlite::fromJSON("https://www.sec.gov/files/company_tickers_exchange.json")
Warning: URL 'https://www.sec.gov/files/company_tickers_exchange.json': status was 'SSL connect error'Error in open.connection(con, "rb") :
cannot open the connection to 'https://www.sec.gov/files/company_tickers_exchange.json'
Thank you in advance for any help!
What I've tried
I am trying to run this on a new work computer, it runs fine on my old work computer but the new one gives me this error.
It seems the difference causing this issue is that I am using {jsonlite} 1.8.2 on my new computer and 1.8.0 on my old computer. Deep in the definition of the fromJSON() function, the working version seems to use curl::curl() to establish a connection whereas the not-working version uses base::url().
The following example line from the help documentation runs fine on the new computer with version 1.8.2
data1 <- fromJSON("https://api.github.com/users/hadley/orgs")
I can access the JSON file I am trying to read on an internet browser.
I do not have permission to install Rtools on my computer to be able to compile an older version of {jsonlite}.

Mlflow not running on machine

Please I am trying to run mlflow code in R after having installed it. However, after loading the library with library(mlflow) and I run mlflow_log_params("foo",42) I get the error message below printed in my console:
Error in rethrow_call(c_processx_exec, command, c(command, args), pty, :
Command 'C:/Users/IFEANYI/AppData/Local/r-miniconda/envs/r-mlflow-1.19.0/mlflow' not found #win/processx.c:982 (processx_exec)
I also get the same error message when I run mlflow_ui(). Please was there something I ought to have done during installation failure of which is affecting its functionality? Do I need to install and load the processx library in order for mlflow to run on my Windows10 machine? I really hope I can get advice to help me because I want to use mlflow in my machine learning projects. Thanks in advance of your generous help.
The error should disappear when setting MLFLOW_BIN system variable (Windows) to mlflow cli executable : "....conda\envs\r-mlflow-1.24.0\Scripts\mlflow.exe".
If it works please mark the problem as resolved.
Unfortunately, you will get next error "Error in wait_for(function() mlflow_rest("experiments", "list", client = client)" for which I cannot find the solution

How to apply Spark configuration settings from R markdown document parameters

this is my first post so please be kind to me and my poor English.
I'm interested in running this code (this is just the script). It seems that running the code without customizing it is not possible but I don't understand what I should change.
Maybe I just installed Spark badly? I'm using the latest version of RStudio, this text says this but I don't understand if the latest version is suitable.
Please note that sparklyr version 0.7.0+ (available on GitHub, but not
yet released on CRAN) is needed.
I can tell you that the error occurs when it arrives in this line of code.
# Apply Spark configuration settings from R markdown document parameters
spark_param_names <- grep("spark.", names(params),
fixed = TRUE, value = TRUE)
the error is the following
Error in shell_connection(master = master, spark_home = spark_home, app_name = app_name, :
Failed to connect to Spark (SPARK_HOME is not set).
I'm a student and I'm not very experienced thanks for your patience

How to bypass repos error when installing repository on internet disconnected machine?

I've found a number of different methods that can be used to install packages on a machine that isn't connected to the internet. This post offers a fairly straightforward method to download the packages, transfer to the disconnected machine, and then to point the R installation at this custom repository.
After transferring the files, I ran the following command on the machine not connected to the internet:
update.packages(repos="C:/Users/username/Documents/R/R Repository/3.4",repos = NULL,type = "source")
After running the above line, I am getting the following error:
Error in update.packages(repos = "C:/Users/username/Documents/R/R Repository/3.4", :
formal argument "repos" matched by multiple actual arguments
Another thing I noticed is that the downloaded packages are all ".tar.gz" files, and this is a windows machine (as was the machine in the linked post above). Could this be part of the problem?
Any help would be much appreciated, thank you!
It looks like you have "repos =" twice in your call. Take out "repos = NULL" and try it again.

Issue with R - Shiny command runGitHub() [duplicate]

I am trying to install a sample package from my github repo:
https://github.com/jpmarindiaz/samplepkg
I can install it when the repo is public using any of the following commands through the R interpreter:
install_github("jpmarindiaz/rdali")
install_github("rdali",user="jpmarindiaz")
install_github("jpmarindiaz/rdali",auth_user="jpmarindiaz")
But when the git repository is private I get an Error:
Installing github repo samplepkg/master from jpmarindiaz
Downloading samplepkg.zip from
https://github.com/jpmarindiaz/samplepkg/archive/master.zip
Error: client error: (406) Not Acceptable
I haven't figured out how the authentication works when the repo is private, any hints?
Have you tried setting a personal access token (PAT) and passing it along as the value of the auth_token argument of install_github()?
See ?install_github way down at the bottom (Package devtools version 1.5.0.99).
Create an access token in:
https://github.com/settings/tokens
Check the branch name and pass it to ref
devtools::install_github("user/repo"
,ref="main"
,auth_token = "tokenstring"
)
A more modern solution to this problem is to set your credentials in R using the usethis and credentials packages.
#set config
usethis::use_git_config(user.name = "YourName", user.email = "your#mail.com")
#Go to github page to generate token
usethis::create_github_token()
#paste your PAT into pop-up that follows...
credentials::set_github_pat()
#now remotes::install_github() will work
remotes::install_github("username/privaterepo")
More help at https://happygitwithr.com/common-remote-setups.html#common-remote-setups

Resources