File: asJSON.function.R

package info (click to toggle)
r-cran-jsonlite 1.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: ansic: 3,792; sh: 9; makefile: 6
file content (11 lines) | stat: -rw-r--r-- 254 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
setMethod("asJSON", "function", function(x, collapse = TRUE, fun = c("source", "list"), 
  ...) {
  # validate
  fun <- match.arg(fun)
  
  if (fun == "source") {
    return(asJSON(deparse(x), ...))
  } else {
    return(asJSON(as.list(x), ...))
  }
})