Skip to content
Prev 374522 / 398513 Next

help with json data from the web into data frame in R

You might need to hack fromJSON to get your verification issues fixed:
function (txt, simplifyVector = TRUE, simplifyDataFrame = simplifyVector, 
    simplifyMatrix = simplifyVector, flatten = FALSE, ...) 
{
    if (!is.character(txt) && !inherits(txt, "connection")) {
        stop("Argument 'txt' must be a JSON string, URL or file.")
    }
    if (is.character(txt) && length(txt) == 1 && nchar(txt, type = "bytes") < 
        1000 && !validate(txt)) {
        if (grepl("^https?://", txt, useBytes = TRUE)) {
            loadpkg("curl")
            h <- curl::new_handle(useragent = paste("jsonlite /", 
                R.version.string))
            curl::handle_setheaders(h, Accept = "application/json, text/*, */*")
            txt <- curl::curl(txt, handle = h)
        }
        else if (file.exists(txt)) {
            txt <- file(txt)
        }
    }
    fromJSON_string(txt = txt, simplifyVector = simplifyVector, 
        simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix, 
        flatten = flatten, ...)
}
<environment: namespace:jsonlite>
David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law