Thanks, that is perfect!
On Thu, Sep 2, 2021 at 7:02 PM Deepayan Sarkar
wrote:
>
> On Thu, Sep 2, 2021 at 9:26 PM Enrico Schumann
> wrote:
> >
> > On Thu, 02 Sep 2021, Luigi Marongiu writes:
> >
> > > Hello, is it possible to show only the header (that is: `'data.frame':
> > > x obs. of y vari
ere are cheaper solutions.
-Original Message-
From: R-help On Behalf Of Rui Barradas
Sent: Thursday, September 2, 2021 7:31 AM
To: Luigi Marongiu ; r-help
Subject: Re: [R] Show only header of str() function
Hello,
Not perfect but works for data.frames:
header_str <- function(x){
On Thu, Sep 2, 2021 at 9:26 PM Enrico Schumann wrote:
>
> On Thu, 02 Sep 2021, Luigi Marongiu writes:
>
> > Hello, is it possible to show only the header (that is: `'data.frame':
> > x obs. of y variables:` part) of the str function?
> > Thank you
>
> Perhaps one more solution. You could limit th
iu ; r-help
Subject: Re: [R] Show only header of str() function
Hello,
Not perfect but works for data.frames:
header_str <- function(x){
capture.output(str(x))[[1]]
}
header_str(iris)
header_str(AirPassengers)
header_str(1:10)
Hope this helps,
Rui Barradas
Às 12:02 de 02/09/21,
On Thu, 02 Sep 2021, Luigi Marongiu writes:
> Hello, is it possible to show only the header (that is: `'data.frame':
> x obs. of y variables:` part) of the str function?
> Thank you
Perhaps one more solution. You could limit the number
of list components to be printed, though it will leave
a "tr
ptember 2, 2021 7:02 AM
To: r-help
Subject: [R] Show only header of str() function
Hello, is it possible to show only the header (that is: `'data.frame':
x obs. of y variables:` part) of the str function?
Thank you
--
Best regards,
Luigi
__
Thank you! better than dim() anyway.
Best regards
Luigi
On Thu, Sep 2, 2021 at 1:31 PM Rui Barradas wrote:
>
> Hello,
>
> Not perfect but works for data.frames:
>
>
> header_str <- function(x){
>capture.output(str(x))[[1]]
> }
> header_str(iris)
> header_str(AirPassengers)
> header_str(1:10)
Hello,
Not perfect but works for data.frames:
header_str <- function(x){
capture.output(str(x))[[1]]
}
header_str(iris)
header_str(AirPassengers)
header_str(1:10)
Hope this helps,
Rui Barradas
Às 12:02 de 02/09/21, Luigi Marongiu escreveu:
Hello, is it possible to show only the header (t
Hello, is it possible to show only the header (that is: `'data.frame':
x obs. of y variables:` part) of the str function?
Thank you
--
Best regards,
Luigi
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailma
9 matches
Mail list logo