Description Usage Arguments Details Value Examples
read.str and read_str read the structure printed
when utils::str.data.frame() back into a data frame.
1 2 3 |
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. |
read.str and read_str are roughly inverses of str.data.frame, except:
read.str subsets to rows where the str results contain the complete
data for the observation,
attributes are dropped, and
list and matrix columns are unsupported.
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.
A data frame of the class specified in the first line of input.
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))))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.