creating a function that converts GET() results to a data frame

Hey there,

trying to write a function that invokes other functions from the httr and jsonlite packages

What I want the function to do is take the result of a GET() call and then go through the steps of converting to text then to json then to a data frame, and the output would be a data frame

Here is what I have so far

crime_test < GET("{ }")

convert_df <- function(obj){
  content(obj, "text") -> x
  fromJSON(x, flatten=TRUE) -> y


#  Error in content(obj, "text") : is.response(x) is not TRUE 
#4. stop(simpleError(msg, call = if (p <- sys.parent(1L)) 
#2.content(obj, "text") 
#1.convert_df(obj = "crime_test")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.