r - Difference between tmpList["colName"=="value"] and tmpList["colName"=="value",] -
i had big list of data in r, , used following line:
subsetlist <- tmplist[tmplist$colname=="value"]
where colname name of column in list , 'value' text wanted subset 'tmplist' on.
the result received complete replication of 'tmplist' in new list.
after experimenting, used following instead:
subsetlist <- tmplist[tmplist$colname=="value" , ]
(note comma inserted.)
now 'subsetlist' contains rows content of column given 'colname' matching "value".
why first attempt return rows? , why second attempt return rows matching equivalence criteria?
Comments
Post a Comment