This question can be hard to answer but maybe you can guide me about debuging such issue.
I wrote few scripts, many functions, one above the other. I develop in recent version of RStudio (with recent R installed). I finished my first beta of script and wanted to "try it out". While I was running it in RStudio (even right after restart RStudio, before loading any librarys) everything works fine.
So I used
"C:\Program Files\R\R-2.15.2\bin\x64\Rscript.exe" "path to script\script.R" > "log_out.log" 2> "log_err.log"
.
And it failed.
log_exec_out.log
did not produce any output,
log_exec_err.log
contains the error message:
Error in file(con, "r") : cannot open the connection
Calls: exec ... get_info.json -> fromJSON -> fromJSON -> I -> structure -> unique
Execution halted
So, I checked the clean R:
Error in file(con, "r") : cannot open the connection
It looks like the same error, at least to some point, traceback() gives me following info:
13: file(con, "r")
12: readLines(content)
11: paste(readLines(content), collapse = "\n")
10: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
9: suppressWarnings(paste(readLines(content), collapse = "\n"))
8: unique(c("AsIs", oldClass(x)))
7: structure(x, class = unique(c("AsIs", oldClass(x))))
6: I(suppressWarnings(paste(readLines(content), collapse = "\n")))
5: fromJSON(url)
4: fromJSON(url) at my_script2.R#58
3: get_info.json(symbol, day = "all") at my_script1.R#116
2: actualize_df(symbol, df) at #13
1: exec("symbol_name", csv_dump = FALSE)
The json url points to the following data structure: https://pln.bitcurex.com/data/trades.json
which I think is correct and should not cause any problems.
Other connections to websites, like read.csv(url...) works fine in clean R.
Issue might be related to RJSONIO but it's very strange it's working in RStudio.
Could you advise what can be the problem and what should be my next step in debugging?
Thank you