An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120914/d6253818/attachment.pl>
Any way to get read.table.ffdf() (in the ff package) to pass colClasses or comment.char parameters through to read.fwf() ?
2 messages · Anthony Damico, Jan Wijffels
3 days later
Hi Anthony,
You are right, read.table.ffdf does not handle additional arguments passed
on to read.table in the method read.fwf as you expect. read.table.ffdf
checks the arguments of read.fwf and colClasses is not one of them,
colClasses is part of ... which is passed on to read.table.
You should report this to the package author. A way on how to circumvent it
is by using the following code after which read.fwf will work as you expect
it with arguments comment.char and colClasses.
read.fwf.default <- get("read.fwf")
read.fwf <- function(file, widths, header = FALSE, sep = "\t", skip = 0,
row.names, col.names, n = -1, buffersize = 2000, comment.char = "#",
colClasses = NA, ...){
read.fwf.default(file=file, widths=widths, header=header, sep=sep,
skip=skip, row.names=row.names, col.names=col.names, n=n,
buffersize=buffersize, comment.char = comment.char, colClasses = colClasses,
...)
}
v <- read.table.ffdf(file=fwffile, FUN="read.fwf", widths=c(1,2,3),
colClasses = 'factor')
hope this helps,
Jan
--
View this message in context: http://r.789695.n4.nabble.com/Any-way-to-get-read-table-ffdf-in-the-ff-package-to-pass-colClasses-or-comment-char-parameters-throu-tp4643171p4643413.html
Sent from the R help mailing list archive at Nabble.com.