knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE )
staypuft is a port of Python's marshmallow for converting objects to and from R data structures
Main Schema methods:
- load: 'deserialize', or validate and deserialize an input R data structure (e.g., list) to an object
- dump: 'serialize', or convert any input (e.g., R6 class) to R data structures (e.g., list)
- load_json: same as load, but accepts JSON
- dump_json: same as dump, but returns JSON
remotes::install_github("ropensci/staypuft")
library("staypuft")
z <- Schema$new("MySchema", name = fields$character(), title = fields$character(), num = fields$integer() ) z x <- list(name = "Jane Doe", title = "Howdy doody", num = 5.5) z$load(data = x)
staypuft in R doing citation(package = 'staypuft')Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.