make_safeframe {safeframe}R Documentation

Create a safeframe from a data.frame

Description

This function converts a data.frame or a tibble into a safeframe object, where data are tagged and validated. The output will seem to be the same data.frame, but safeframe-aware packages will then be able to automatically use tagged fields for further data cleaning and analysis.

Usage

make_safeframe(.data, ...)

Arguments

.data

a data.frame or a tibble

...

<dynamic-dots> A series of tags provided as tag_name = "column_name"

Value

The function returns a safeframe object.

See Also

Examples


x <- make_safeframe(cars,
  mph = "speed",
  distance = "dist"
)

## print result - just first few entries
head(x)

## check tags
tags(x)

## tags can also be passed as a list with the splice operator (!!!)
my_tags <- list(
  mph = "speed",
  distance = "dist"
)
new_x <- make_safeframe(cars, !!!my_tags)

## The output is strictly equivalent to the previous one
identical(x, new_x)


[Package safeframe version 1.0.0 Index]