jitter_metrics {vivainsights}R Documentation

Jitter metrics in a data frame

Description

Convenience wrapper around jitter() to add a layer of anonymity to a query. This can be used in combination with anonymise() to produce a demo dataset from real data.

Usage

jitter_metrics(data, cols = NULL, ...)

Arguments

data

Data frame containing a query.

cols

Character vector containing the metrics to jitter. When set to NULL (default), all numeric columns in the data frame are jittered.

...

Additional arguments to pass to jitter().

Value

data frame where numeric columns specified by cols are jittered using the function jitter().

See Also

anonymise

Examples

jittered <- jitter_metrics(pq_data, cols = "Collaboration_hours")

# compare jittered vs original results of top rows
head(
  data.frame(
    original = pq_data$Collaboration_hours,
    jittered = jittered$Collaboration_hours
  )
)


[Package vivainsights version 0.5.2 Index]