R/asJSON.NULL.R

# Note that this is different from RJSONIO because null values are NA.
setMethod("asJSON", "NULL", function(x, null = "list", ...) {
  if(null == "null"){
    return("null")
  } else {
    return("{}")
  }
})

Try the jsonlite package in your browser

Any scripts or data that you put into this service are public.

jsonlite documentation built on July 9, 2023, 6:11 p.m.