Sometimes it may be tempting to import some x data into R , for example. read.table , and then change its levels with levels(x$V1) <- c(...) . Columns are initially imported into factors unless we use the as.is parameter and specify colClasses="character" . We can consider the possibility of simultaneously converting levels on all columns of a large data frame, but then we want to make sure that all these columns (which we assume here contain the same data type, for example, the same levels in general) have levels ordered by the same way.
My multi-user question is as follows:
- Is the sort order a specification of the R language, so is it platform independent?
- Is it some sort of alphabetical sorting, and if so, according to which alphabet?
See for example:
> x = as.factor(c("3","$$$av","1","2","^ab", "^ba", "3","aba","4","-ab","ba",'3',"ba")) > x [1] 3 $$$av 1 2 ^ab ^ba 3 aba 4 -ab ba 3 ba Levels: 1 2 3 4 ^ab -ab aba $$$av ba ^ba
r
jaybee
source share