read.flist: Read a formatting list from the file system

View source: R/flist.R

read.flistR Documentation

Read a formatting list from the file system

Description

The read.flist function reads a formatting list from the file system. The function accepts a path to the formatting list, reads the list, and returns it.

Usage

read.flist(file_path)

Arguments

file_path

The path to the formatting list.

Value

The formatting list as an R object.

See Also

Other flist: as.data.frame.fmt_lst(), as.flist(), as.flist.data.frame(), as.flist.fcat(), as.flist.list(), as.flist.tbl_df(), flist(), is.flist(), print.fmt_lst(), write.flist()

Examples

# Create formatting list
fl <- flist(f1 = "%5.1f",
            f2 = "%6.2f",
            type = "row")
           
# Get temp directory
tmp <- tempdir()            
           
# Save formatting list to file system
pth <- write.flist(fl, dir_path = tmp)

# Read from file system
fr <- read.flist(pth)

# Create sample data
dat <- c(12.3844, 292.28432)

# Use formats in the catalog
fapply(dat, fr)
# [1] " 12.4"  "292.28"

dbosak01/fmtr documentation built on June 15, 2024, 4:26 a.m.