Display a corner section of a rectangular data set
corner(x, ...)# S3 method for data.frame
corner(x, r = 5L, c = 5L, corner = "topleft",
...)
# S3 method for matrix
corner(x, r = 5L, c = 5L, corner = "topleft", ...)
# S3 method for table
corner(x, r = 5L, c = 5L, corner = "topleft", ...)
# S3 method for default
corner(x, r = 5L, ...)
... The part of the data set that was requested. The size depends on r and c and the position depends on corner.
The data
Arguments passed on to other functions
Number of rows to display
Number of columns to show
Which corner to grab. Possible values are c("topleft", "bottomleft", "topright", "bottomright")
Jared P. Lander
Grabs a corner of a data set
Display a corner section of a rectangular data set
Displays a corner of a rectangular data set such as a data.frame, matrix or table. If showing the right side or bottom, the order of the data is preserved.
The default method reverts to simply calling head
corner of a rectangular data set such as a data.frame, matrix or table. If showing the right side or bottom, the order of the data is preserved.
data(diamonds)
head(diamonds) # displays all columns
corner(diamonds) # displays first 5 rows and only the first 5 columns
corner(diamonds, corner="bottomleft") # displays the last 5 rows and the first 5 columns
corner(diamonds, corner="topright") # displays the first 5 rows and the last 5 columns
Run the code above in your browser using DataLab