Re: [R] Show only header of str() function

2021-09-02 Thread Luigi Marongiu
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

Re: [R] Show only header of str() function

2021-09-02 Thread Rui Barradas
re 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){ ca

Re: [R] Show only header of str() function

2021-09-02 Thread Deepayan Sarkar
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

Re: [R] Show only header of str() function

2021-09-02 Thread Avi Gross via R-help
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,

Re: [R] Show only header of str() function

2021-09-02 Thread Enrico Schumann
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

Re: [R] Show only header of str() function

2021-09-02 Thread Avi Gross via R-help
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 __ R-help@r-p

Re: [R] Show only header of str() function

2021-09-02 Thread Luigi Marongiu
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)

Re: [R] Show only header of str() function

2021-09-02 Thread Rui Barradas
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

[R] Show only header of str() function

2021-09-02 Thread Luigi Marongiu
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