library(data.table)
x <- data.table(rnorm(5))
setnames(x, new = "v1") |> summary()
This code works but feels strange. The reason is that the set functions in data.table do not return anything. In C++, pipe operator only works on functions that return something.
Any clarification would be highly appreciated.