Hi I'm very new to R, so I have some basic questions.
I want to sort ordinal data (a factor) from 104 observations in 43 variables (first is the Name of the Observation and 42 variables ) coded as 1, 2, and 3. Naturally R thinks it is a numerical data. So first question: is there an easy way to change the data type for every variable after the first at once?
I found this code:
mutate_if(is.numeric, ~as.factor(as.character(.)))
or
mutate_at(vars(Clavicula medial r:Fibula distal l), ~as.integer(as.character(.)))
But it produces the error: mutat_if is not found (currently there are no packages in use except “reader”)
The next question would be if R can arrange the data in ascending order. It is biological data so we have overlapping and missing data. R should arrange the observations with as little overlap as possible.
Here an example how my Data looks like: