Error: Error in 1:nrow(input_data_frame) : argument of length 0 while using get_timeseries

Hi,

I am getting the above addressed error while running the get_timeseries. It is not a consistent error, sometimes it appear and sometimes it does not

NCLData <- get_timeseries(list(paste0(CFTCRICS[i],"NLNG")),start_date = paste(floor_date(Sys.Date() - years(14), "year"),"T00:00:00",sep = ""),end_date = paste(LastDayInMonth(Sys.Date()),"T00:00:00",sep = ""))

where CFTCRICS[1]="4005602".Sometimes while running, it shows error:

Error in 1:nrow(input_data_frame) : argument of length 0

and sometimes it runs properly. Please Help,

Thank you

Best Answer

  • Jirapongse
    Answer ✓

    @niket.chauhan

    You may need to set the debug to TRUE to verify the retrieved response.

    NCLData <- get_timeseries(
        list(paste0(CFTCRICS[i],"NLNG")),
        start_date = paste(floor_date(Sys.Date() - years(14), "year"),"T00:00:00",sep = ""),
        end_date = paste(LastDayInMonth(Sys.Date()),"T00:00:00",sep = ""),
        debug = TRUE)

Answers

  • Hello, I have the same problem but when I try to use debug = T the console shows me this:

    [1] "Request *************************************"
    {"Entity":{"E":["TimeSeries"],"W":{"rics":[["USTARTSD=ME"],["ARSAc1"],["ARSAc2"]],"fields":[["TIMESTAMP"],["CLOSE"]],"interval":["daily"],"startdate":["2024-01-22T00:00:00"],"enddate":["2024-01-26T23:59:59"]}}}
    [1] "Response *************************************"
    [1] "{\"ErrorCode\":500,\"ErrorMessage\":\"Backend error. 500 Internal Server Error\"}"
    [1] "Response status *************************************"
    [1] 200