# NOT RUN {
format_json_rowwise(mtcars[1:3, ])
# use a dataframe column for nested objects
df <- data.frame(x = 1:2)
df$y <- data.frame(z = c("a", "b"))
format_json_rowwise(df)
if (require("dplyr", quietly = TRUE, warn.conflicts = FALSE)) {
tibble <- tibble::tibble
# often useful in mutate/transmute
mtcars %>%
transmute(json = format_json_rowwise(tibble(mpg, cyl, extra = tibble(disp, hp))))
}
# }
Run the code above in your browser using DataLab