Let say that I have 10 objects in R environment named a.1, a.2, ..., a.10
for(i in 1:10) assign(paste("a", i, sep="."), iris)
rm(i)
If I were to call ls()
, it would return as:
"a.1" "a.10" "a.2" "a.3" "a.4" "a.5" "a.6" "a.7" "a.8" "a.9"
instead of
"a.1" "a.2" "a.3" "a.4" "a.5" "a.6" "a.7" "a.8" "a.9" "a.10"
May I know if there's any method to force ls()
to return in the latter sequence, instead of the former?