I have a loop going through a list of ISIN/SEDOL names I want converted to RICs. Once it encounters an ISIN it deems invalid I get an error as below and the loop exists.
Error in print.default("HTTP Error, code= ", response$status_code, sep = "") :
invalid 'digits' argument
I tried using a try clause with the silent option on but the get_symbology stops working after the first fail and the following code gives me NAs for all calls after the first error. If I do the calls one by one for each ISIN the commands work properly but I have a long list and want the loop to work.
RIC_vec <- vector("character",length = N)
for (i in 1:N) {
RIC_ID <- try(get_symbology(comps[i,2][[1]],
from_symbol_type = "ISIN",
to_symbol_type = "RIC"),silent=T)
print(i)
if ("RIC" %in% names(RIC_ID)) {
RIC_vec[i] <- RIC_ID[1,2]}
else {
RIC_vec[i] <- NA}
}
I'm using the eikonapir package in R.
Thanks,
Claudiu