Learn R Programming

rmdwc (version 0.3.0)

rmdwcl: Word-, character and non-whitespace characters count for a text

Description

Counts words, characters and non-whitespace characters in a string. Is used in rmdcount, see details there.

Usage

rmdwcl(rmd, space = "[[:space:]]", word = "[[:space:]]+", line = "\n")

Value

a list

Arguments

rmd

character: R Markdown document as string

space

character: pattern to split a text at spaces (default: '[[:space:]]')

word

character: pattern to split a text at word boundaries (default: '[[:space:]]+')

line

character: pattern to split lines (default: '\n')

Examples

Run this code
file  <- system.file('rmarkdown/rstudio_pdf.Rmd', package="rmdwc")
fcont <- readChar(file, file.info(file)$size)
rmdwcl(fcont)

Run the code above in your browser using DataLab