我经常使用 dplyr 管道将一列从 tibble 转换为向量,如下所示
iris %>% .$Sepal.Length
iris %>% .$Sepal.Length %>% cut(5)
Run Code Online (Sandbox Code Playgroud)
如何使用最新的 R 内置管道符号执行相同操作 |>
iris |> .$Sepal.Length
iris |> .$Sepal.Length |> cut(5)
Error: function '$' not supported in RHS call of a pipe
Run Code Online (Sandbox Code Playgroud)