[R] How to print the objects in the memory

Matthew Keller mckellercran at gmail.com
Wed Jan 31 16:18:42 CET 2007


Hi usstata,

I think this will get you what you want:

mget(ls(),globalenv())


On 1/31/07, usstata <usstata at 126.com> wrote:
> Hi,all:
>
>        May be a  pointless question
>
>        a <- 1:10
>        b <- matrix(1:8,nrow = 4)
>        c <- letters[4:8]
>        ……
>
>        > ls()
>        [1] "a"      "b"      "c"
>
>        ls() can print the names of the objects in the memory ,
>
>        but I want to get the result :
> > a
> [1]  1  2  3  4  5  6  7  8  9 10
> > b
>     [,1] [,2]
> [1,]    1    5
> [2,]    2    6
> [3,]    3    7
> [4,]    4    8
> > c
> [1] "d" "e" "f" "g" "h"
> ……
>
>                I try the command print(noquote(ls()))  which it can't help
>
>
> Best regards
> usstata
>
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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