baptiste auguie-5 wrote:
>
>
> I wish to modify programmatically only a few factor levels, according
> to a named list. I came up with this function..
>
> .
> It seems to work, but the original order of the levels is changed.
>
>
The split-and-unite policy you use makes it a bit diff
Dear list,
I wish to modify programmatically only a few factor levels, according
to a named list. I came up with this function,
modify.levels <- function(f, modify=list()){
## levels that will not be changed
names.old.levels <- setdiff(levels(f), unlist(modify))
## as a named list
old.le
2 matches
Mail list logo