[Rd] how to manipulate dput output format

From: andre zege <andre.zege_at_gmail.com>
Date: Tue, 19 Jun 2012 11:04:00 -0400


I am reading into Java dput output for a matrix, more specifically for a file backed big-matrix. I basically need to lift dimnames for a matrix from dput output. It's no big deal, but the code is very 'hackish' due to the need to get rid of quotes, endlines, parenthesis, etc. I was wondering if i could manipulate to an extent dput output with some options that define it, for example, get rid of quoting each element in matirx dimnames somehow. Another great thing wiould be to make dput dump rownames and colnames on two separate lines, but i don't think it's possible. To give a specific example, instead of dput output like

**new("big.matrix.descriptor"

    , description = structure(list(sharedType = "FileBacked", filename =
"res", totalRows = 1528,

    totalCols = 53040, rowOffset = c(0, 1528), colOffset = c(0,     53040), nrow = 1528, ncol = 53040, rowNames = c("A", "AA",     "RNT.A", "ADVA", "AAPL", "AAS", "ABFS", "ABM", "ABT", "ACI",     .......

I'd prefer ideally to have it in the form where rownames and colnames don't have quotes and newlines and if possible are on separate lines

new("big.matrix.descriptor"

    , description = structure(list(sharedType = "FileBacked", filename =
"res", totalRows = 1528,

    totalCols = 53040, rowOffset = c(0, 1528), colOffset = c(0,     53040), nrow = 1528, ncol = 53040,
rowNames = c(A, AA, RNT.A, ADVA, AAPL, AAS, ABFS, ABM, ABT, ... ) colNames = c(...)

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 19 Jun 2012 - 15:06:49 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Jun 2012 - 02:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive