wc: Count Letters, Words, and Lines of a File

Description Usage Arguments Details Value Examples

View source: R/wc.r

Description

See title.

Usage

1
2
3
4
5
wc(file, chars = TRUE, words = TRUE, lines = TRUE)

wc_w(file)

wc_l(file)

Arguments

file

Location of the file (as a string) from which the counts will be generated.

chars, words, lines

Should char/word/line counts be shown? At least one of the three must be TRUE.

Details

wc_l() is a shorthand for counting only lines, similar to wc -l in the terminal. Likewise wc_w() is analogous to wc -w for words.

Value

A list containing the requested counts.

Examples

1
2
3
library(filesampler)
file = system.file("rawdata/small.csv", package="filesampler")
data = wc(file=file)

wrathematics/lineSampler documentation built on Feb. 27, 2020, 8:01 p.m.