[R] why the dim gave me different results

2010-06-02 Thread Changbin Du
dim(tmp) [1] 576 12 tmp 1 10 11 12 13 2 3 4 5 6 7 9 10 0 0 0 0 0 0 12 0 0 0 0 20 0 0 0 0 0 0 15 0 0 0 0 30 0 0 0 0 0 0 11 0 0 0 0 40 0 0 0 0 0 0 11 0 0 0 0 50 0 0 0 0 0 0 12 0 0 0 0 60 0 0 0

Re: [R] why the dim gave me different results

2010-06-02 Thread Joris Meys
Hi Changbin, it's not line numbers. It's row names, and you deleted some of them. If you checked, you'd have seen that eg 107-109 are missing. So you have 576 lines left from a matrix that had 600 when it was formed. Cheers Joris On Wed, Jun 2, 2010 at 11:47 PM, Changbin Du changb...@gmail.com

Re: [R] why the dim gave me different results

2010-06-02 Thread Phil Spector
Changbin - If you take the time to look at your data frame, you'll see the following 24 numbers are missing from the rownames. 78 84 107 108 109 158 164 194 197 203 240 241 243 255 256 264 275 277 282 284 300 305 311 312 (I found this using (1:600)[!(1:600) %in% rownames(tmp)] )

Re: [R] why the dim gave me different results

2010-06-02 Thread Murat Tasan
row names are not the same as line numbers or indices. you've likely done some row-based selection on an original matrix or data frame. observe from the example below. (and in the future please don't expect people to sort through your 500+ line matrices by hand to find your problems.) x -

Re: [R] why the dim gave me different results

2010-06-02 Thread RICHARD M. HEIBERGER
This is a guess since you didn't say where it comes from. It looks like a data.frame where some rows were deleted. Also, note that the column names in your example are sorted alphabetically instead of numerically. This example shows one way to get that behavior. Rich tmp -

Re: [R] why the dim gave me different results

2010-06-02 Thread Changbin Du
Thanks all of you, I appreciated! On Wed, Jun 2, 2010 at 2:58 PM, Phil Spector spec...@stat.berkeley.eduwrote: Changbin - If you take the time to look at your data frame, you'll see the following 24 numbers are missing from the rownames. 78 84 107 108 109 158 164 194 197 203 240 241