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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -