View source: R/epi_head_and_tail.R
epi_head_and_tail | R Documentation |
epi_head_and_tail() prints the first and last few rows of a data.frame
epi_head_and_tail(df = NULL, rows = 5, cols = 5, last_cols = FALSE)
df |
data.frame as input |
rows |
Number of rows to print, default is 5 |
cols |
Number of columns to print, default is 5 |
last_cols |
Print the last columns instead of the first few, default is FALSE |
Similar to data.table printing of a data.table object but works for a tibble or data.frame, or any object that can be coerced to a data.frame
Antonio Berlanga-Taylor <https://github.com/AntonioJBT/episcout>
## Not run:
n <- 20
df <- data.frame(
var_id = rep(1:(n / 2), each = 2),
var_to_rep = rep(c('Pre', 'Post'), n / 2),
x = rnorm(n),
y = rbinom(n, 1, 0.50),
z = rpois(n, 2)
)
df
dim(df)
epi_head_and_tail(df)
epi_head_and_tail(df, rows = 2, cols = 2)
epi_head_and_tail(df, rows = 2, cols = 2, last_cols = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.