Learn R Programming

whapi (version 0.0.2)

whapi_scalarize_change: Collapse a "changes" vector into a single string

Description

Normalizes the webhook changes field (which may be NULL, vector, or nested list) into a single comma-separated string of unique values.

Usage

whapi_scalarize_change(x)

Value

A character scalar (comma-separated) or NA_character_ if empty.

Arguments

x

A character vector, list, or NULL from Whapi payload.

Examples

Run this code
whapi_scalarize_change(c("text","text","reactions"))
# "text,reactions"

whapi_scalarize_change(NULL) # NA

Run the code above in your browser using DataLab