如何查找大于 R 中任何值的行数

问题描述 投票:0回答:1

我想要表格和绘图的行数大于列中任何特定值 例如行数大于 74、行数大于 51 以及...

table(data$weight)只是计算74的数量,51的数量和...但不大于这个值。 我想要这个的线性图。 有人可以帮忙吗? 预先感谢。

data:
    height     weight  
2th     192     74   
8th     185     51  
4th     174     50    
3th     173     83  
5th     172     74    
7th     171     66 
10th    170     51  
1th     167     86  
6th     167     66     
9th     163     50 

表格(数据$权重)

r dataframe plot filter datatable
1个回答
0
投票

根据评论:

table(datain$weight) |> 
  rev() |> 
  cumsum() |> 
  rev()

给出:

50 51 66 74 83 86 
10  8  6  4  2  1 
© www.soinside.com 2019 - 2024. All rights reserved.