[R] data frame
Stefano Calza
stef at biostatistics.it
Mon Sep 17 18:18:10 CEST 2007
Ciao,
do you mean the number of records?
something like
nrow(a)
I would also suggest ncol(a) instad of length, which would work for a matrix as well.
[Italian]
E' quello che cercavi?
[/Italian]
Ciao
Stefano
On Mon, Sep 17, 2007 at 06:05:58PM +0200, Alfredo Alessandrini wrote:
<Alfredo>Hi everybody,
<Alfredo>
<Alfredo>If I've a data frame like this:
<Alfredo>
<Alfredo>dataframe a
<Alfredo>
<Alfredo> X0 X2 X4 X6 X8 X10 X12 X14 X16
<Alfredo>1957 0 0 0 0 0 0 0 0 0
<Alfredo>1958 0 0 0 0 0 0 0 0 0
<Alfredo>1959 831 0 0 0 0 0 0 0 0
<Alfredo>1960 544 282 0 0 0 0 0 0 0
<Alfredo>1961 446 365 0 0 0 0 0 0 0
<Alfredo>1962 442 473 0 0 0 0 0 0 0
<Alfredo>1963 595 468 0 0 0 0 0 0 0
<Alfredo>1964 400 397 516 0 0 0 0 0 0
<Alfredo>1965 417 382 401 0 0 0 0 0 0
<Alfredo>1966 642 518 509 453 0 0 0 0 0
<Alfredo>1967 505 340 621 458 0 0 0 0 0
<Alfredo>1968 451 383 428 318 339 0 0 0 0
<Alfredo>
<Alfredo>> length (a)
<Alfredo>[1] 9
<Alfredo>
<Alfredo>I've a questions...
<Alfredo>
<Alfredo>There is a function for show the lenght of single observation?
<Alfredo>
<Alfredo>> ???? (a)
<Alfredo>[1] 12
<Alfredo>
<Alfredo>
<Alfredo>
<Alfredo>Best Wishes,
<Alfredo>
<Alfredo>Alfredo
<Alfredo>
<Alfredo> [[alternative HTML version deleted]]
<Alfredo>
<Alfredo>______________________________________________
<Alfredo>R-help a r-project.org mailing list
<Alfredo>https://stat.ethz.ch/mailman/listinfo/r-help
<Alfredo>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
<Alfredo>and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list