function_list[[i]](value) 中的 round() 错误:在 R 中找不到对象

round() Error in function_list[[i]](value) : object not found in R

在停止使用 R 后,我遇到了一个问题。目前,我正在使用一个包含两列的数据框。我的目标是将第一列 fheight 舍入,然后过滤并有选择地将 fheightsheight 添加到新数据框(如果它等于 71)。当我添加 round()函数我收到错误 Error in function_list[[i]](value) : object 'fheight' not found.

father.son.adjusted <- father.son %>% 
  group_by(fheight) %>%
  round(fheight) %>% 
  filter(fheight == 71) %>% 
  select(fheight, sheight)

我的数据是数值如下

    
    fheight     sheight
1   65.04851    59.77827
2   63.25094    63.21404
3   64.95532    63.34242
4   65.75250    62.79238
5   61.13723    64.28113
6   63.02254    64.24221
7   65.37053    64.08231
8   64.72398    63.99574

当我 运行 这个没有圆形函数的片段时,一切正常。我阅读了有关 round 函数问题的其他问题,但无法破译我自己的错误。非常感谢您的帮助。

尝试检查一下:

library(dplyr)
father.son.adjusted <- father.son %>%
  mutate(fheight=round(fheight)) %>%
  group_by(fheight) %>%
  filter(fheight == 71) %>% 
  select(fheight, sheight)