[Rd] [bug] droplevels() also drop object attributes (comment…)
Serge Bibauw
sbibauw at gmail.com
Mon May 15 17:59:32 CEST 2017
Hi,
Just reporting a small bug… not really a big deal, but I don’t think that is intended: droplevels() also drops all object’s attributes.
Example:
> > test <- c("hello", "something", "hi")
> > test <- factor(test)
> > comment(test) <- "this is a test"
> > attr(test, "description") <- "this is another test"
> > attributes(test)
> $levels
> [1] "hello" "hi" "something"
>
> $class
> [1] "factor"
>
> $comment
> [1] "this is a test"
>
> $description
> [1] "this is another test"
>
> > test <- droplevels(test)
> > attributes(test)
> $levels
> [1] "hello" "hi" "something"
>
> $class
> [1] "factor"
Serge
[[alternative HTML version deleted]]
More information about the R-devel
mailing list