Learn R Programming

Tmisc (version 1.0.1)

peek: Peek at the top of a text file

Description

This returns a character vector which shows the top n lines of a file.

Usage

peek(x, n = 5)

Arguments

x

a filename

n

the number of lines to return

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab