epi_head_and_tail: Print the first few rows and last few rows of a data frame

Description Usage Arguments Note Author(s) Examples

View source: R/epi_head_and_tail.R

Description

epi_head_and_tail() prints the first and last few rows of a data.frame

Usage

1
epi_head_and_tail(df = NULL, rows = 5, cols = 5, last_cols = FALSE)

Arguments

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

Note

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

Author(s)

Antonio Berlanga-Taylor <https://github.com/AntonioJBT/episcout>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

AntonioJBT/episcout documentation built on Nov. 7, 2019, 5:34 p.m.