read.file | R Documentation |
read.file
reads a file word by word and returns a unicode
character vector.
read.file(text.file, max.length = -1, lower = FALSE, bow = FALSE, ...)
text.file |
A character vector. The path to the text file |
max.length |
A numeric. The maximum length of space delimited units to be read (defaults to the entire file). |
lower |
Boolean. Whether or not to lowercase all words. |
bow |
Boolean. Whether or not to substitute each word with an ID tag (useful for non-ASCII texts) |
... |
arguments to be passed to |
The read.file
helper function reads a character vector from
a file up to max.length
calling PreprocessText
if nececssary to carry out any preprocessing steps.
scan
, PreprocessText
## initialize a temp buffer
tmp.file <- file()
cat("this is a very nice and short sentence", file = tmp.file)
text <- read.file(tmp.file, max.length = 1000, lower = TRUE, bow = TRUE)
close(tmp.file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.