Strange that OpenCPU cannot display the values between 1e-05 to ~1e-04 correctly. All these values will be returned as exact 0.
Here is the R code,
test_bug = function(){
# genrate values from 1e-05 to 1e-04
data = data.frame(value = c(seq(0.00001,0.0001,by=0.0000001)))
return(data)
}
There is no error in the format of print or csv. However, the format of json is incorrect.
The url of http://localhost:5656/ocpu/tmp/x0567909793/R/.val/print would return
Thanks a lot. It works for the URL. However, is there a way of displaying 10 digits for obj in the session.getObject(function(obj){})? My obj output is still 0s.
Strange that OpenCPU cannot display the values between 1e-05 to ~1e-04 correctly. All these values will be returned as exact 0.
Here is the R code,
There is no error in the format of
print
orcsv
. However, the format ofjson
is incorrect. The url ofhttp://localhost:5656/ocpu/tmp/x0567909793/R/.val/print
would returnHowever, the url of
http://localhost:5656/ocpu/tmp/x0567909793/R/.val/json
returnsThis is critical to me because I often extract the result using
session.getObject(function(obj){})
, where theobj
is in thejson
format.