read.str: Read the results of 'str.data.frame' back into a data frame

Description Usage Arguments Details Value Examples

View source: R/str.R

Description

read.str and read_str read the structure printed when utils::str.data.frame() back into a data frame.

Usage

1
2
3
read.str(file = clipr::read_clip())

read_str(file = clipr::read_clip())

Arguments

file

Character. A path to a file, a connection, or literal data (either a single string or a vector of lines). If unspecified, reads from the clipboard.

Details

read.str and read_str are roughly inverses of str.data.frame, except:

Classes at the top of the str results are reassigned, so both vanilla data.frames and variants like tbl_df and data.table are supported. Because class is determined by the data, read_str is merely an alias.

Value

A data frame of the class specified in the first line of input.

Examples

1
2
3
4
read.str(capture.output(str(iris)))

# Resulting class is determined by input, not read.str vs. read_str
read_str(capture.output(str(tibble::as_tibble(iris))))

alistaire47/read.so documentation built on April 23, 2020, 12:50 p.m.