I have data that looks like the following, except the numbers are out of order:
dat<-
paste("Experience",1:20,sep="_")
Basically, I am trying to sort the columns in numerical order based on the ending number to order them as the code above produces. However, when I sort
the values, it sorts based on the first digit as such:
"Experience_1" "Experience_10" "Experience_11" "Experience_12"
"Experience_13" "Experience_14" "Experience_15" "Experience_16"
"Experience_17" "Experience_18" "Experience_19" "Experience_2"
"Experience_20" "Experience_3" "Experience_4" "Experience_5"
"Experience_6" "Experience_7" "Experience_8" "Experience_9"
Thoughts?