subset - Getting variable names of desired values in R -
my data (group) has 300 variables showing group belong in second row..there total of 6 groups
2017 2766 1737 1745 1747 1883 1884 1821 1900 ...... 3 4 6 3 3 3 3 3 3 ...... if this:
group=="6" it show if variables true or false if belong group 6 below
2017 2766 1737 1745 1747 1883 1884 1821 1900 .............. false false true false false false false false false .............. i trying list out variables belong individual group.
example want ask variables belong group 6
i tried gave null results:
names(group=="6") i want save names csv.
try
colnames(group)[which(group=="6")] when group data.frame or else
names(group)[which(group=="6")]
Comments
Post a Comment