R:滤波器问题 - `filter()`::!计算时问题`..1 =(数据$ column,400,1800)'
我有一个数据框架,并希望根据与另一列有关的条件获得子集。这似乎适用于某个变量,但是对于一个特定的变量,我会收到以下错误消息:
Error in `filter()`:
! Problem while computing `..1 = between(Unitranche$Yield, 400, 1800)`.
Caused by error in `Unitranche$Yield`:
! $ operator is invalid for atomic vectors
Run `rlang::last_error()` to see where the error occurred.
代码如下:
X = filter(data, X == 1)
Y = filter(data, Y == 1)
Z = filter(data), Z == 1)
直到这里没有问题,但是:
X = filter(X, between(X$a,400,1500))
Y = filter(Y, between(Y$a,400,1800))
Z = filter(Z, a >= 800)
尽管y是创建/过滤y的,但该错误弹出了y。就像X和Z一样。
不确定如何使用示例数据复制此错误;但是,以防万一是5个变量的278个观察结果。
谢谢你!
I have a data frame and am looking to get a subset based on conditions related to another column. This seems to work for some variable, but somehow for one particular one, I am getting the following error message:
Error in `filter()`:
! Problem while computing `..1 = between(Unitranche$Yield, 400, 1800)`.
Caused by error in `Unitranche$Yield`:
! $ operator is invalid for atomic vectors
Run `rlang::last_error()` to see where the error occurred.
The code is as follows:
X = filter(data, X == 1)
Y = filter(data, Y == 1)
Z = filter(data), Z == 1)
no problem until here, but then:
X = filter(X, between(X$a,400,1500))
Y = filter(Y, between(Y$a,400,1800))
Z = filter(Z, a >= 800)
The error pops up for Y, although Y is created/filtered exactly like the X and Z.
Not sure how to replicate this error with sample data; but just in case Y is 278 observations of 5 variables.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论