r - Subset rows which have a column inside numeral interval -


i subset lines have "chr" column 1 29, in "cnv1" dataframe.

i tried it:

cnvk <- cnv1[cnv1$chr==1:29,] 

but not lines have 1,2,3...29.

cheers!

try

cnvk <- cnv1[cnv1$chr %in% 1:29,] 

or

cnvk <- cnv1[cnv1$chr>=1 & cnv1$chr<=29,] 

(the latter might quicker if you're checking against large range of values)


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -