Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
第一行,其中一列中的值高于另一列中的值R_R_Data.table - Fatal编程技术网

第一行,其中一列中的值高于另一列中的值R

第一行,其中一列中的值高于另一列中的值R,r,data.table,R,Data.table,我有一个数据表: df <- data.table(Points = 1:5, A = c(2,4,6,8,10), B = c(1,3,4,5,9)) df <- Points A B 1 2 1 2 4 3 3 6 4 4 8 5 5 10 9 df这个怎么样: df[,Points[应用(外部(A,B,` B中的任何值都不大于A)您的描述不清楚。是否需要df[,B[哪个(shift(B>shift(A)))]]与l

我有一个数据表:

df <- data.table(Points = 1:5, A = c(2,4,6,8,10), B = c(1,3,4,5,9))
df <- 
Points  A B
  1     2 1
  2     4 3
  3     6 4
  4     8 5
  5    10 9
df这个怎么样:


df[,Points[应用(外部(A,B,` B中的任何值都不大于A)您的描述不清楚。是否需要
df[,B[哪个(shift(B>shift(A)))]]
与lagno进行比较,而不是shift。给定一个代表一个人特征的a值,我需要在B中找到第一个比a中的值高的值以及相应的点。这更清楚吗?所以你不是在明智地比较元素,是不是类似于
Lappy(df$a,function(x)df$B>x)
,但仍然没有给出预期的