Row and Col length of a matrix?

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

Row and Col length of a matrix?

Whalojazz
Hi,

Is there a direct command to get the row and col length of a matrix?

My ugly solution is: length(mtx[,1]) and length(bcf[1,])

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Row and Col length of a matrix?

Jorge I Velez
See ?dim

HTH,

Jorge


On Tue, Jun 17, 2008 at 4:50 PM, MeMooMeM <[hidden email]> wrote:

>
> Hi,
>
> Is there a direct command to get the row and col length of a matrix?
>
> My ugly solution is: length(mtx[,1]) and length(bcf[1,])
>
> Thanks!
>
> --
> View this message in context:
> http://www.nabble.com/Row-and-Col-length-of-a-matrix--tp17936978p17936978.html
> Sent from the R help mailing list archive at Nabble.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
> and provide commented, minimal, self-contained, reproducible code.
>

        [[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
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Row and Col length of a matrix?

Erik Iverson
In reply to this post by Whalojazz
See ?dim, ?nrow, ?ncol.

MeMooMeM wrote:
> Hi,
>
> Is there a direct command to get the row and col length of a matrix?
>
> My ugly solution is: length(mtx[,1]) and length(bcf[1,])
>
> Thanks!
>

______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Row and Col length of a matrix?

RKoenker
Oh, and don't forget:  NROW and NCOL


url:    www.econ.uiuc.edu/~roger            Roger Koenker
email    [hidden email]            Department of Economics
vox:     217-333-4558                University of Illinois
fax:       217-244-6678                Champaign, IL 61820


On Jun 17, 2008, at 3:54 PM, Erik Iverson wrote:

> See ?dim, ?nrow, ?ncol.
>
> MeMooMeM wrote:
>> Hi, Is there a direct command to get the row and col length of a  
>> matrix? My ugly solution is: length(mtx[,1]) and length(bcf[1,])
>> Thanks!
>>
>
> ______________________________________________
> [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
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[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
and provide commented, minimal, self-contained, reproducible code.