peek: peek at the top of a text file

Description Usage Arguments Author(s) Examples

View source: R/peek.R

Description

this returns a character vector which shows the top n lines of a file. Note: I realized after the fact that this is essentially a duplicate of the base R function readLines.

Usage

1
peek(x, n = 2)

Arguments

x

a filename

n

the number of lines to return

Author(s)

Michael I. Love

Examples

1
2
3
4
5
filename <- tempfile()
x<-matrix(round(rnorm(10^4),2),1000,10)
colnames(x)=letters[1:10]
write.csv(x,file=filename,row.names=FALSE)
peek(filename)

ririzarr/rafalib documentation built on April 17, 2021, 8:56 p.m.