'less' for R?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

'less' for R?

Federico Calboli
Hi All,

is there an equivalent of the Unix command 'less' (or 'more'), so I can
look at what's inside a data.frame or a matrix without having it printed
out on console?

I am using R on Debian Linux and Mac OS 10.4.5

Cheers,

F

--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602     Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: 'less' for R?

Duncan Murdoch
On 3/8/2006 12:03 PM, Federico Calboli wrote:
> Hi All,
>
> is there an equivalent of the Unix command 'less' (or 'more'), so I can
> look at what's inside a data.frame or a matrix without having it printed
> out on console?
>
> I am using R on Debian Linux and Mac OS 10.4.5

I think you want page().  head() and tail() are also useful, as
equivalents to the head and tail commands.

Duncan Murdoch

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: 'less' for R?

Christos Hatzis-2
Or
fix(data.frame)
to open it in the spreadsheet-like data editor.

-Christos Hatzis

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Duncan Murdoch
Sent: Wednesday, March 08, 2006 12:26 PM
To: [hidden email]
Cc: r-help
Subject: Re: [R] 'less' for R?

On 3/8/2006 12:03 PM, Federico Calboli wrote:
> Hi All,
>
> is there an equivalent of the Unix command 'less' (or 'more'), so I
> can look at what's inside a data.frame or a matrix without having it
> printed out on console?
>
> I am using R on Debian Linux and Mac OS 10.4.5

I think you want page().  head() and tail() are also useful, as equivalents
to the head and tail commands.

Duncan Murdoch

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: 'less' for R?

Romain François
In reply to this post by Federico Calboli
Le 08.03.2006 18:03, Federico Calboli a écrit :

> Hi All,
>
> is there an equivalent of the Unix command 'less' (or 'more'), so I can
> look at what's inside a data.frame or a matrix without having it printed
> out on console?
>
> I am using R on Debian Linux and Mac OS 10.4.5
>
> Cheers,
>
> F
>  
Hi,

A cheap way is to use the unix command :
> less <- function(a){
>        write.table(a, quote=F, file="/tmp/dataframe.txt")
>        system("less /tmp/dataframe.txt")
>        }
> less(iris)
Romain

--
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
Discover the R Movies Gallery : http://addictedtor.free.fr/movies
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: 'less' for R?

Wincent
In reply to this post by Christos Hatzis-2
As Prof Brian Ripley has pointed out,That changes the object if you
make a change in the editor, so definitely
NOT to be recommended.

And you should use invisible(edit(dat.frame)) instead.

2006/3/9, Christos Hatzis <[hidden email]>:

> Or
> fix(data.frame)
> to open it in the spreadsheet-like data editor.
>
> -Christos Hatzis
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Duncan Murdoch
> Sent: Wednesday, March 08, 2006 12:26 PM
> To: [hidden email]
> Cc: r-help
> Subject: Re: [R] 'less' for R?
>
> On 3/8/2006 12:03 PM, Federico Calboli wrote:
> > Hi All,
> >
> > is there an equivalent of the Unix command 'less' (or 'more'), so I
> > can look at what's inside a data.frame or a matrix without having it
> > printed out on console?
> >
> > I am using R on Debian Linux and Mac OS 10.4.5
>
> I think you want page().  head() and tail() are also useful, as equivalents
> to the head and tail commands.
>
> Duncan Murdoch
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
黄荣贵
Deparment of Sociology
Fudan University


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: 'less' for R?

Florence Combes
In reply to this post by Federico Calboli
you can also use str(data.frame) which allows you to access the structure of
your object.

Florence.


On 3/8/06, Federico Calboli <[hidden email]> wrote:

>
> Hi All,
>
> is there an equivalent of the Unix command 'less' (or 'more'), so I can
> look at what's inside a data.frame or a matrix without having it printed
> out on console?
>
> I am using R on Debian Linux and Mac OS 10.4.5
>
> Cheers,
>
> F
>
> --
> Federico C. F. Calboli
> Department of Epidemiology and Public Health
> Imperial College, St Mary's Campus
> Norfolk Place, London W2 1PG
>
> Tel  +44 (0)20 7594 1602     Fax (+44) 020 7594 3193
>
> f.calboli [.a.t] imperial.ac.uk
> f.calboli [.a.t] gmail.com
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html