Utility to add (prepend) a class(es) to existing objects.
Examples
class(iris)
#> [1] "data.frame"
addClass(iris, "new") |> class()
#> [1] "new" "data.frame"
addClass(iris, c("A", "B")) |> class() # 2 classes
#> [1] "A" "B" "data.frame"
addClass(iris, c("A", "data.frame")) |> class() # no duplicates
#> [1] "A" "data.frame"
addClass(iris, c("data.frame", "A")) |> class() # re-orders if exists
#> [1] "data.frame" "A"