You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alathea edited this page Jul 11, 2014
·
7 revisions
Ask and answer questions!
Data Structures
What's the difference between levels(f1) <- rev(levels(f1)) and factor(letters, levels=rev(letters))? The help says "Note that for a factor, replacing the levels via levels(x) <- value is not the same as (and is preferred to) attr(x, "levels") <- value." I don't understand why the first one actually modifies the factor and the other only acts on the levels.