[R] stop a function

David Winsemius dwinsemius at comcast.net
Fri Jan 30 19:40:28 CET 2015


On Jan 30, 2015, at 2:20 AM, n omranian via R-help wrote:

> Hi All,
> I'm getting actually nuts. I don't understand the following lines in R:
> Here is the data, all rows are exactly the same!

Their print representation may be "exactly the same", but their internal values may differ by an amount that does not show up with your current print settings. We would need to see dput( ord_data[pid,] ) to comment further.

-- 
David

>> ord_data[pid,]
>              c0m2     c0m4     c0m8  c0m16    c0m24    c0m48     c0p2     c0p4     c0p8   c0p16    c0p24    c0p48   c24m2    c24m4    c24m8  c24m16
> 13336382 5.632195 6.442133 5.818143 5.7683 5.862075 6.533181 5.807341 6.709774 5.664199 5.54022 5.385181 6.531977 5.29061 5.776121 6.136176 6.34699
> 13465320 5.632195 6.442133 5.818143 5.7683 5.862075 6.533181 5.807341 6.709774 5.664199 5.54022 5.385181 6.531977 5.29061 5.776121 6.136176 6.34699
> 13467455 5.632195 6.442133 5.818143 5.7683 5.862075 6.533181 5.807341 6.709774 5.664199 5.54022 5.385181 6.531977 5.29061 5.776121 6.136176 6.34699
> 13518680 5.632195 6.442133 5.818143 5.7683 5.862075 6.533181 5.807341 6.709774 5.664199 5.54022 5.385181 6.531977 5.29061 5.776121 6.136176 6.34699
>            c24m24   c24m48    c24p2    c24p4    c24p8   c24p16  c24p24   c24p48
> 13336382 5.489161 6.043948 5.807802 5.761756 5.833559 5.293438 5.92068 5.759683
> 13465320 5.489161 6.043948 5.807802 5.761756 5.833559 5.293438 5.92068 5.759683
> 13467455 5.489161 6.043948 5.807802 5.761756 5.833559 5.293438 5.92068 5.759683
> 13518680 5.489161 6.043948 5.807802 5.761756 5.833559 5.293438 5.92068 5.759683
> 
> Now I found correlation:
>> pcor <- cor(t((ord_data[pid,])))
>> pcor
>          13336382 13465320 13467455 13518680
> 13336382        1        1        1        1
> 13465320        1        1        1        1
> 13467455        1        1        1        1
> 13518680        1        1        1        1
> But, then I get this funny result !!!
> all(pcor[,1]==1)
> [1] FALSE
>> pcor[2,2]==1
> [1] TRUE
>> pcor[3,2]==1
> [1] FALSE
> Could anybody please comment on this?Many thanks.
> 
> 
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list