[R] R ``literal'' comand
John Vokey
vokey at uleth.ca
Wed Jun 14 09:24:49 CEST 2006
I know I am luddite when it comes to list-based languages, such as
R. But, even these beasts must occasionally want to access objects
at a literal level. For example, to a naive twit like me, x<--print
(y) should deposit in x a literal print out of y; that is, x should
contain the *results* of applying the print method to y (e.g.,
something like a tab (or space)-delimited flat sheet). Sadly, no.
It contains a copy of y. That is, x<--print(y) == x<--y. I spend
more time fighting with all the list crapola (technical term for, uh,
crapola) in each object than I ever manage successfully to use the
object. To cut through the, uh, technical stuff, every now and again
I would just like to get a simple flat object back with NO list
baggage. Something like: z=literal(x), where literal() returns a
flat spreadsheet-like structure with named columns and rows.
Data.frame() comes close, but it always *interprets* the object
first, which means it is usually quite different from what one saw
with the simple print(y).
Yeah, I know, I will now get a flood of emails telling me to get with
the program and to learn to love y[[1]] and S4 methods or some such,
or, worse: why not just write the program myself? I agree. I am an
ignorant twit. But, aside from saving (or copying from the screen:
my current solution) the data to a text file to remove all the list,
uh, stuff (and ignoring the no doubt great pleasure to be had by
chiming in to agree with my exalted twittedness), what does one do?
--
Please avoid sending me Word or PowerPoint attachments.
See <http://www.gnu.org/philosophy/no-word-attachments.html>
-Dr. John R. Vokey
More information about the R-help
mailing list