Off topic:How to extract top 5% number infomation from matrix by using R?
0
0
Entering edit mode
@yangxiujujuju-21714
Last seen 4.7 years ago

Hello, I heve a matrix(4260*34), a part as follow:

> matrix
       brown              grey                  yellow            green                   white                blue
A -1.149255e-03 2.860265e-03 9.198340e-04 5.144036e-03 0.0026969686 5.746249e-03
B -9.174336e-04 8.317152e-03 -1.360653e-03 6.653484e-03 0.0065084797 1.006139e-02
C -7.864003e-03 -1.925244e-02 -1.097666e-03 1.098523e-02 0.0322852911 -1.666910e-02
D -7.039214e-03 -1.279118e-02 -1.351395e-03 6.403375e-03 0.0063110152 -9.466401e-03
E -7.040558e-03 -1.679522e-02 5.303559e-03 2.541649e-02 0.0249588512 -1.357130e-02
F 3.566300e-04 1.973854e-03 6.582043e-03 1.015424e-02 -0.0035802723 3.627824e-03
G 3.268834e-03 -4.372850e-03 -6.720695e-03 2.718662e-03 -0.0045350115 3.312930e-03
H -1.655860e-04 6.670511e-03 1.830364e-03 9.082381e-03 0.0256364955 2.357959e-03
I 1.185147e-02 -2.999770e-04 -1.264101e-03 3.508225e-02 0.0210897963 -1.898114e-04
J 4.564741e-03 7.082577e-03 4.027961e-03 1.801338e-02 -0.0012343277 4.510357e-03
K -8.806285e-03 -1.694895e-02 -1.134117e-01 -1.529373e-01 -0.0765283194 -1.916946e-01
M 1.241366e-03 3.154813e-02 4.881584e-02 -1.303083e-02 -0.0133092729 -2.146324e-02

I want to extract top 5% number informations, the result as follow: 0.0026969686 A white 0.0065084797 B white 0.0322852911 C white 0.006311015 D white

But I don't know how to do this use R code. Can you help me?

R • 138 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 845 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6