[R] Help

Adrian Dușa dusa.adrian at unibuc.ro
Tue Jun 20 15:26:44 CEST 2017


One solution, among many, involving recoding. There is a function in
package QCA called recode()
(similar, but in my opinion more flexible than the same function recode()
in package car)

> library(QCA)
> ind.davis$Ageclass <- recode(ind.davis$Ageclass, "adult = Adult; Juvanile
 = Juvenile; sub-adult = Sub-adult", as.factor.result = TRUE)

Should work, although untested (your example is not replicable).

Hope this helps,
Adrian

On Tue, Jun 20, 2017 at 8:06 AM, Leonardo Malaguti <
leonardomalaguti27 at gmail.com> wrote:

> Dear expert friends,
> I'm pretty young of this world and  my question at your eyes can be petty
> easy.
> I'll need to change the name of the levels inside a column of my data-frame
>
> levels(ind.davis$Ageclass) <- c("adult", "Juvanile", "sub-adult")
> names(ind.davis$Ageclass) <- c("Adult", "Juvenile", "Sub-adult")
> that is what I tried but of course doesn't work.
>
> Thanks,
> have a wonderful day,
> Leo
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr. 90-92
050663 Bucharest sector 5
Romania

	[[alternative HTML version deleted]]



More information about the R-help mailing list