Copied over from https://github.com/tidyverse/dplyr/issues/719
reclass(x, result)
result, now with class/attributes restored.
result
The original object, which has a class/attributes to copy
The modified object, which is / might be missing the class/attributes.