From sbibauw at gmail.com  Mon May 15 17:59:32 2017
From: sbibauw at gmail.com (Serge Bibauw)
Date: Mon, 15 May 2017 11:59:32 -0400
Subject: [Rd] =?utf-8?q?=5Bbug=5D_droplevels=28=29_also_drop_object_attrib?=
 =?utf-8?b?dXRlcyAoY29tbWVudOKApik=?=
Message-ID: <f72658b5-4f45-4936-afb9-a4b4b78dc9a1@Spark>

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]]



[Rd] =?utf-8?q?=5Bbug=5D_droplevels=28=29_also_drop_object_attrib?= =?utf-8?b?dXRlcyAoY29tbWVudOKApik=?=
Serge Bibauw