textreadr (version 0.3.0)

peek: Data Frame Viewing

Description

peek - Convenience function to view all the columns of the head of a truncated data.frame. peek invisibly returns x. This makes its use ideal in a dplyr/magrittr pipeline.

unpeek - Strips out class textreadr so that the entire data.frame will be printed.

Usage

peek(x, n = 10, width = 20, ...)
unpeek(x)

Arguments

x
A data.frame object.
n
Number of rows to display.
width
The width of the columns to be displayed.
...
For internal use.

Value

Prints a truncated head but invisibly returns x.

Details

By default dplyr does not print all columns of a data frame (tbl_df). This makes inspection of data difficult at times, particularly with text string data. peek allows the user to see a truncated head for inspection purposes.

See Also

head

Examples

Run this code
peek(mtcars)
peek(presidential_debates_2012)

Run the code above in your browser using DataCamp Workspace