[deletions, including attribution, which I think were Stavros then Luke then Peter:]

In R, most data types (including numeric vectors) do not have a standard
external representation which can be read back in without evaluation.
The default print form is not readable in this sense but dput is
available for this purpose.

I think the point is that dput() is not always equivalent to the object - parsing dput output gives a different object from the original. Numeric vectors of length > 1 is the most obvious case, "expression" objects another (those can get terribly confusing at times).

I would have thought the save() format (possibly with ascii=TRUE) was the standard external representation. I believe your examples and 1.0/3 both survive save()/load().

Or does "standard external representation" imply that the parser can reconstruct the object? If so, there would be other things besides .const that would be needed. In particular, environments and the more exotic types like promises and external pointers aren't deparsed in a parsable way. Environments and promises do survive save/load, but I don't think there's any way external pointers could.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to