[R] R equivalent of Python str()?

Martin Maechler maechler at stat.math.ethz.ch
Wed Feb 8 09:45:05 CET 2012


>>>>> "R Michael Weylandt <michael.weylandt at gmail.com>"
>>>>> <michael.weylandt at gmail.com>
>>>>>     on Tue, 7 Feb 2012 20:23:57 -0500 writes:

    > Possibly as.character() is what the OP was seeking
    > Michael

or   format()   which is closer for numeric data


    > On Feb 7, 2012, at 7:15 PM, jim holtman <jholtman at gmail.com> wrote:

    >> ?dump
    >> ?dput
    >> 
    >> 2012/2/7 Ernest Adrogué <nfdisco at gmail.com>:
    >>> Hi,
    >>> 
    >>> I was wondering if there's a function in R that is meant to return a
    >>> string representation of an object. Basically, it's like print() but
    >>> it doesn't print anything, it only returns a string.
    >>> 
    >>> I know there's a str() function but it's not quite the same. I mean a
    >>> function that returns the same string that print() would display.
    >>> 
    >>> --
    >>> Bye, Ernest
    >>> 
    >>> ______________________________________________ R-help at 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.
    >> 
    >> 
    >> 
    >> -- 
    >> Jim Holtman Data Munger Guru
    >> 
    >> What is the problem that you are trying to solve?  Tell me what you
    >> want to do, not how you want to do it.
    >> 
    >> ______________________________________________ R-help at 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.

    > ______________________________________________ R-help at 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.



More information about the R-help mailing list