【发布时间】:2018-12-26 12:12:06
【问题描述】:
我需要知道因子的每个级别是否提供递增的值。我见过How to check if a sequence of numbers is monotonically increasing (or decreasing)?,但不知道如何仅适用于单个级别。 假设有数据框 df 被分成人。每个人都有多年的身高。现在我想知道数据集是否正确。因此,我需要知道身高是否有增加值 - 每人:
我试过了
Results<- by(df, df$person,
function(x) {data = x,
all(x == cummax(height))
}
)
但它不起作用。和
Results<- by(df, df$person,
all(height == cummax(height))
}
)
也没有。我收到找不到高度。 我在这里做错了什么?
小数据提取:
Serial_number Amplification Voltage
1 608004648 111.997 379.980
2 608004648 123.673 381.968
3 608004648 137.701 383.979
4 608004648 154.514 385.973
5 608004648 175.331 387.980
6 608004648 201.379 389.968
7 608004649 118.753 378.080
8 608004649 131.739 380.085
9 608004649 147.294 382.082
10 608004649 166.238 384.077
11 608004649 189.841 386.074
12 608004649 220.072 388.073
13 608004650 115.474 382.066
14 608004650 127.838 384.063
15 608004650 142.602 386.064
16 608004650 160.452 388.056
17 608004650 182.732 390.060
18 608004650 211.035 392.065
Serial_number是因素,我想检查每个序列号是否对应的放大值在增加。
【问题讨论】:
-
不,不需要。我会添加一些数据。
标签: r