R/read.documents.R

read.documents <-
function (filename = "mult.dat") 
{
    one <- scan(filename, what = "", sep = "\n")
    two <- chartr(":", " ", one)
    three <- strsplit(two, " ", fixed = TRUE)
    lapply(three, function(x) matrix(as.integer(x[-1]), nrow = 2))
}

Try the lda package in your browser

Any scripts or data that you put into this service are public.

lda documentation built on May 1, 2019, 10:34 p.m.