json.collapse: collapse columns in a dataframe to a single JSON column

View source: R/utilities.R

json.collapseR Documentation

collapse columns in a dataframe to a single JSON column

Description

collapse columns in a dataframe to a single JSON column

Usage

json.collapse(data, field, colNames)

Arguments

data

dataframe containing one or more columns

field

name to give JSON column

colNames

a single or an array of column names to convert to JSON records

Examples


# Multiple columns
data = json.collapse(data, "newField", c("field1","field2"))
# OR single column
data = json.collapse(data, "newField", "field1")


namc-utah/NAMCr documentation built on Feb. 12, 2024, 4:29 a.m.