Add or modify columns in JSON data.
Arguments
- .data
A
tbl_lazy_jsonobject.- ...
Name-value pairs of expressions. The name gives the name of the column in the output. The value should be an expression using existing columns, e.g.
new_col = col1 + col2.Conditional helpers are translated to JavaScript:
ifelse()andif_else()become ternary operators, andcase_when()becomes a chained set of ternary operators.case_when()clauses without aTRUE ~ ...catch-all yieldnullfor unmatched rows, matchingdplyr'sNAdefault.across()is expanded on the R side into one column per selection. It accepts a single function (across(c(a, b), round)), a formula lambda (across(c(a, b), ~ .x * 2)), or a named list of functions (across(c(a, b), list(double = ~ .x * 2))). Column selections acceptc(...), a bare column, a character vector, andall_of()/any_of(). Use.nameswith the{.col}/{.fn}glue placeholders to control the output column names; by default a single function reuses the input name and multiple functions produce{.col}_{.fn}.
