Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fattr-set

Set formatting attributes


Description

Assign formatting attributes to a vector

Usage

fattr(x) <- value

Arguments

x

The vector or data frame column to assign attributes to.

value

A named vector of attribute values.

Details

The fattr function is a convenience function for assigning formatting attributes to a vector. The function accepts a named list of formatting attributes. Valid names are 'format', 'width', 'justify', 'label' and 'description'. See fattr for additional details.

See Also

fdata to apply formats to a data frame, fapply to apply formats to a vector.

Examples

# Create vector
a <- c(1.3243, 5.9783, 2.3848)

# Assign format attributes
fattr(a) <- list(format = "%.1f")

# Apply format attributes
fapply(a)

fmtr

Easily Apply Formats to Data

v1.5.0
CC0
Authors
David Bosak
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.