R code list variables in the order they appear -
i trying r give me list of variables in dataframe, not have alphabetical.
i tried ls(df, sorted = false)
says unused argument.
ls()
used list objects in environment. not have sorted
argument, returns values sorted default. info frame, can utilize names
names of column variables. can utilize ls()
if utilize with
create environment info frame
> with(mtcars, ls()) [1] "am" "carb" "cyl" "disp" "drat" "gear" "hp" [8] "mpg" "qsec" "vs" "wt"
and names
not sort variable names
> names(mtcars) [1] "mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" [8] "vs" "am" "gear" "carb"
r
No comments:
Post a Comment