如何选择向量确定的特定行?

时间:2014-05-05 14:05:56

标签: r

我有一个类似的数据框:

> dput(head(tbl_ready))
structure(list(Gene.name = structure(1:6, .Label = c("AT1G01050", 
"AT1G01080", "AT1G01090", "AT1G01220", "AT1G01320", "AT1G01420", 
"AT1G01470", "AT1G01800", "AT1G01910", "AT1G01920", "AT1G01960", 
"AT1G01980", "AT1G02020", "AT1G02100", "AT1G02130", "AT1G02140", 
"AT1G02150", "AT1G02305", "AT1G02500", "AT1G02560", "AT1G02780", 
"AT1G02880", "AT1G02920", "AT1G02930", "AT1G03030", "AT1G03090", 
"AT1G03110", "AT1G03130", "AT1G03210", "AT1G03220", "AT1G03230", 
"AT1G03310", "AT1G03330", "AT1G03475", "AT1G03630", "AT1G03680", 
"AT1G03870", "AT1G03900", "AT1G04080", "AT1G04130", "AT1G04170", 
"AT1G04190", "AT1G04270", "AT1G04350", "AT1G04410", "AT1G04420", 
"AT1G04530", "AT1G04640", "AT1G04690", "AT1G04750", "AT1G04810", 
"AT1G04850", "AT1G04870", "AT1G05010", "AT1G05180", "AT1G05190", 
"AT1G05320", "AT1G05350", "AT1G05520", "AT1G05560", "AT1G05620", 
"AT1G06000", "AT1G06110", "AT1G06130", "AT1G06290", "AT1G06410", 
"AT1G06550", "AT1G06560", "AT1G06570", "AT1G06620", "AT1G06650", 
"AT1G06680", "AT1G06900", "AT1G07080", "AT1G07110", "AT1G07140", 
"AT1G07240", "AT1G07250", "AT1G07370", "AT1G07440", "AT1G07750", 
"AT1G07780", "AT1G07890", "AT1G07990", "AT1G08110", "AT1G08200", 
"AT1G08360", "AT1G08490", "AT1G08520", "AT1G08550", "AT1G08820", 
"AT1G08830", "AT1G08980", "AT1G09010", "AT1G09020", "AT1G09130", 
"AT1G09210", "AT1G09300", "AT1G09310", "AT1G09340", "AT1G09430", 
"AT1G09490", "AT1G09620", "AT1G09640", "AT1G09750", "AT1G09760", 
"AT1G09780", "AT1G09795", "AT1G09830", "AT1G10200", "AT1G10360", 
"AT1G10370", "AT1G10430", "AT1G10590", "AT1G10670", "AT1G10760", 
"AT1G10840", "AT1G11090", "AT1G11360", "AT1G11545", "AT1G11650", 
"AT1G11660", "AT1G11720", "AT1G11750", "AT1G11780", "AT1G11820", 
"AT1G11840", "AT1G11860", "AT1G11870", "AT1G11910", "AT1G11930", 
"AT1G12000", "AT1G12010", "AT1G12050", "AT1G12140", "AT1G12200", 
"AT1G12230", "AT1G12240", "AT1G12250", "AT1G12270", "AT1G12350", 
"AT1G12360", "AT1G12410", "AT1G12520", "AT1G12780", "AT1G12800", 
"AT1G12840", "AT1G12900", "AT1G12920", "AT1G13060", "AT1G13270", 
"AT1G13280", "AT1G13320", "AT1G13440", "AT1G13870", "AT1G13900", 
"AT1G13930", "AT1G14000", "AT1G14030", "AT1G14130", "AT1G14210", 
"AT1G14250", "AT1G14310", "AT1G14320", "AT1G14410", "AT1G14510", 
"AT1G14570", "AT1G14610", "AT1G14700", "AT1G14810", "AT1G14820", 
"AT1G15060", "AT1G15130", "AT1G15140", "AT1G15340", "AT1G15390", 
"AT1G15470", "AT1G15710", "AT1G15730", "AT1G15750", "AT1G15930", 
"AT1G15950", "AT1G16080", "AT1G16190", "AT1G16300", "AT1G16340", 
"AT1G16350", "AT1G16460", "AT1G16720", "AT1G16820", "AT1G16880", 
"AT1G16890", "AT1G16920", "AT1G17050", "AT1G17100", "AT1G17160", 
"AT1G17190", "AT1G17220", "AT1G17290", "AT1G17330", "AT1G17650", 
"AT1G17720", "AT1G17745", "AT1G17890", "AT1G18070", "AT1G18080", 
"AT1G18210", "AT1G18270", "AT1G18440", "AT1G18450", "AT1G18490", 
"AT1G18500", "AT1G18540", "AT1G18590", "AT1G18640", "AT1G19130", 
"AT1G19570", "AT1G19730", "AT1G19740", "AT1G19920", "AT1G20010", 
"AT1G20020", "AT1G20200", "AT1G20220", "AT1G20225", "AT1G20260", 
"AT1G20340", "AT1G20440", "AT1G20450", "AT1G20510", "AT1G20620", 
"AT1G20630", "AT1G20670", "AT1G20950", "AT1G20960", "AT1G21130", 
"AT1G21190", "AT1G21350", "AT1G21400", "AT1G21440", "AT1G21600", 
"AT1G21680", "AT1G21720", "AT1G21750", "AT1G21770", "AT1G22280", 
"AT1G22300", "AT1G22330", "AT1G22360", "AT1G22370", "AT1G22400", 
"AT1G22430", "AT1G22530", "AT1G22800", "AT1G22920", "AT1G22940", 
"AT1G23130", "AT1G23180", "AT1G23190", "AT1G23310", "AT1G23440", 
"AT1G23730", "AT1G23740", "AT1G23800", "AT1G23820", "AT1G23960", 
"AT1G24020", "AT1G24050", "AT1G24100", "AT1G24180", "AT1G24340", 
"AT1G24360", "AT1G24510", "AT1G24610", "AT1G25220", "AT1G25230", 
"AT1G25350", "AT1G25490", "AT1G25570", "AT1G26160", "AT1G26170", 
"AT1G26220", "AT1G26230", "AT1G26520", "AT1G26630", "AT1G26640", 
"AT1G26761", "AT1G27020", "AT1G27030", "AT1G27090", "AT1G27130", 
"AT1G27150", "AT1G27310", "AT1G27450", "AT1G27510", "AT1G27530", 
"AT1G27580", "AT1G27680", "AT1G27970", "AT1G28120", "AT1G28200", 
"AT1G28290", "AT1G28350", "AT1G28440", "AT1G28580", "AT1G28600", 
"AT1G28670", "AT1G28680", "AT1G28960", "AT1G29040", "AT1G29150", 
"AT1G29260", "AT1G29370", "AT1G29660", "AT1G29670", "AT1G29840", 
"AT1G29880", "AT1G29900", "AT1G29980", "AT1G29990", "AT1G30120", 
"AT1G30230", "AT1G30470", "AT1G30510", "AT1G30530", "AT1G30580", 
"AT1G30630", "AT1G30690", "AT1G30910", "AT1G31160", "AT1G31180", 
"AT1G31190", "AT1G31220", "AT1G31230", "AT1G31550", "AT1G31690", 
"AT1G31730", "AT1G31860", "AT1G31910", "AT1G32060", "AT1G32070", 
"AT1G32160", "AT1G32200", "AT1G32220", "AT1G32440", "AT1G32470", 
"AT1G32500", "AT1G32550", "AT1G32900", "AT1G32990", "AT1G33140", 
"AT1G33590", "AT1G33600", "AT1G33680", "AT1G34200", "AT1G34220", 
"AT1G34430", "AT1G34760", "AT1G35160", "AT1G35250", "AT1G35340", 
"AT1G35580", "AT1G35680", "AT1G36160", "AT1G36280", "AT1G36310", 
"AT1G36320", "AT1G36390", "AT1G37130", "AT1G41830", "AT1G42480", 
"AT1G42550", "AT1G42970", "AT1G43170", "AT1G43190", "AT1G43560", 
"AT1G43670", "AT1G43690", "AT1G43710", "AT1G44180", "AT1G44790", 
"AT1G45000", "AT1G45145", "AT1G45150", "AT1G47128", "AT1G47490", 
"AT1G47710", "AT1G48030", "AT1G48170", "AT1G48410", "AT1G48420", 
"AT1G48450", "AT1G48480", "AT1G48520", "AT1G48600", "AT1G48630", 
"AT1G48830", "AT1G48850", "AT1G48860", "AT1G48900", "AT1G49540", 
"AT1G49600", "AT1G49630", "AT1G49650", "AT1G49660", "AT1G49670", 
"AT1G49750", "AT1G49760", "AT1G49820", "AT1G49970", "AT1G50010", 
"AT1G50170", "AT1G50200", "AT1G50320", "AT1G50370", "AT1G50380", 
"AT1G50480", "AT1G50510", "AT1G50670", "AT1G50900", "AT1G50940", 
"AT1G51100", "AT1G51360", "AT1G51410", "AT1G51510", "AT1G51680", 
"AT1G51690", "AT1G51710", "AT1G51760", "AT1G51805", "AT1G51980", 
"AT1G52040", "AT1G52340", "AT1G52360", "AT1G52380", "AT1G52400", 
"AT1G52510", "AT1G52570", "AT1G52670", "AT1G52730", "AT1G53240", 
"AT1G53280", "AT1G53310", "AT1G53430", "AT1G53500", "AT1G53520", 
"AT1G53580", "AT1G53670", "AT1G53750", "AT1G53830", "AT1G53840", 
"AT1G53850", "AT1G54100", "AT1G54220", "AT1G54270", "AT1G54490", 
"AT1G54630", "AT1G54780", "AT1G54830", "AT1G55020", "AT1G55090", 
"AT1G55480", "AT1G55490", "AT1G55810", "AT1G55840", "AT1G56000", 
"AT1G56050", "AT1G56070", "AT1G56190", "AT1G56230", "AT1G56340", 
"AT1G56430", "AT1G56450", "AT1G56500", "AT1G56560", "AT1G56580", 
"AT1G56700", "AT1G57720", "AT1G57790", "AT1G57860", "AT1G58080", 
"AT1G58220", "AT1G58270", "AT1G58280", "AT1G58290", "AT1G59520", 
"AT1G59600", "AT1G59700", "AT1G59830", "AT1G59900", "AT1G59960", 
"AT1G60000", "AT1G60070", "AT1G60420", "AT1G60550", "AT1G60690", 
"AT1G60710", "AT1G60940", "AT1G60990", "AT1G61010", "AT1G61093", 
"AT1G61690", "AT1G61900", "AT1G62020", "AT1G62180", "AT1G62380", 
"AT1G62390", "AT1G62480", "AT1G62560", "AT1G62600", "AT1G62640", 
"AT1G62660", "AT1G62740", "AT1G62750", "AT1G62780", "AT1G62800", 
"AT1G63000", "AT1G63180", "AT1G63460", "AT1G63610", "AT1G63660", 
"AT1G63680", "AT1G63730", "AT1G63770", "AT1G63940", "AT1G63970", 
"AT1G64190", "AT1G64510", "AT1G64520", "AT1G64710", "AT1G64740", 
"AT1G64760", "AT1G64790", "AT1G64840", "AT1G64980", "AT1G65010", 
"AT1G65060", "AT1G65220", "AT1G65260", "AT1G65450", "AT1G65560", 
"AT1G65650", "AT1G65700", "AT1G65860", "AT1G65930", "AT1G65960", 
"AT1G65980", "AT1G66130", "AT1G66200", "AT1G66240", "AT1G66430", 
"AT1G66520", "AT1G66530", "AT1G66670", "AT1G66680", "AT1G66970", 
"AT1G67090", "AT1G67120", "AT1G67280", "AT1G67550", "AT1G67660", 
"AT1G67700", "AT1G68010", "AT1G68540", "AT1G68560", "AT1G68760", 
"AT1G69250", "AT1G69340", "AT1G69410", "AT1G69620", "AT1G69740", 
"AT1G69800", "AT1G69830", "AT1G69960", "AT1G70290", "AT1G70310", 
"AT1G70320", "AT1G70410", "AT1G70570", "AT1G70580", "AT1G70730", 
"AT1G70820", "AT1G70830", "AT1G70890", "AT1G70980", "AT1G71220", 
"AT1G71270", "AT1G71310", "AT1G71440", "AT1G71695", "AT1G71697", 
"AT1G71720", "AT1G71750", "AT1G71790", "AT1G71840", "AT1G71860", 
"AT1G71920", "AT1G72150", "AT1G72160", "AT1G72330", "AT1G72370", 
"AT1G72550", "AT1G72610", "AT1G72660", "AT1G72680", "AT1G72810", 
"AT1G72880", "AT1G72930", "AT1G73060", "AT1G73110", "AT1G73180", 
"AT1G73250", "AT1G73530", "AT1G73600", "AT1G73880", "AT1G74030", 
"AT1G74040", "AT1G74060", "AT1G74070", "AT1G74090", "AT1G74100", 
"AT1G74210", "AT1G74230", "AT1G74260", "AT1G74320", "AT1G74470", 
"AT1G74560", "AT1G74790", "AT1G74910", "AT1G74920", "AT1G74960", 
"AT1G74970", "AT1G75040", "AT1G75210", "AT1G75270", "AT1G75280", 
"AT1G75330", "AT1G75350", "AT1G75660", "AT1G75690", "AT1G75750", 
"AT1G75780", "AT1G75950", "AT1G75990", "AT1G76010", "AT1G76030", 
"AT1G76080", "AT1G76140", "AT1G76160", "AT1G76450", "AT1G76550", 
"AT1G76680", "AT1G76730", "AT1G76790", "AT1G77060", "AT1G77090", 
"AT1G77120", "AT1G77122", "AT1G77490", "AT1G77510", "AT1G77550", 
"AT1G77670", "AT1G77760", "AT1G77940", "AT1G78060", "AT1G78190", 
"AT1G78270", "AT1G78280", "AT1G78300", "AT1G78370", "AT1G78380", 
"AT1G78570", "AT1G78630", "AT1G78680", "AT1G78820", "AT1G78830", 
"AT1G78850", "AT1G78870", "AT1G78900", "AT1G79210", "AT1G79230", 
"AT1G79260", "AT1G79280", "AT1G79330", "AT1G79440", "AT1G79470", 
"AT1G79500", "AT1G79550", "AT1G79650", "AT1G79690", "AT1G79720", 
"AT1G79750", "AT1G79790", "AT1G79830", "AT1G79850", "AT1G79870", 
"AT1G79920", "AT1G79930", "AT1G80360", "AT1G80380", "AT1G80410", 
"AT1G80460", "AT1G80480", "AT1G80490", "AT1G80500", "AT1G80560", 
"AT1G80600", "AT1G80670", "AT2G01140", "AT2G01190", "AT2G01210", 
"AT2G01250", "AT2G01290", "AT2G01350", "AT2G01490", "AT2G01620", 
"AT2G01630", "AT2G01755", "AT2G01820", "AT2G01890", "AT2G02010", 
"AT2G02390", "AT2G02400", "AT2G02500", "AT2G02560", "AT2G02740", 
"AT2G03430", "AT2G03550", "AT2G03640", "AT2G03750", "AT2G03760", 
"AT2G03780", "AT2G03980", "AT2G04030", "AT2G04039", "AT2G04400", 
"AT2G04440", "AT2G04450", "AT2G04530", "AT2G04690", "AT2G04700", 
"AT2G04780", "AT2G04842", "AT2G04845", "AT2G05260", "AT2G05710", 
"AT2G05830", "AT2G05840", "AT2G05920", "AT2G05990", "AT2G06050", 
"AT2G06850", "AT2G06990", "AT2G07360", "AT2G09990", "AT2G10940", 
"AT2G11890", "AT2G13360", "AT2G13440", "AT2G13540", "AT2G13560", 
"AT2G14170", "AT2G14260", "AT2G14750", "AT2G15490", "AT2G15620", 
"AT2G15790", "AT2G16060", "AT2G16230", "AT2G16370", "AT2G16780", 
"AT2G16890", "AT2G16950", "AT2G17130", "AT2G17190", "AT2G17200", 
"AT2G17265", "AT2G17340", "AT2G17390", "AT2G17420", "AT2G17510", 
"AT2G17630", "AT2G17840", "AT2G18020", "AT2G18110", "AT2G18230", 
"AT2G18850", "AT2G19170", "AT2G19470", "AT2G19480", "AT2G19520", 
"AT2G19570", "AT2G19670", "AT2G19760", "AT2G19770", "AT2G19940", 
"AT2G20140", "AT2G20270", "AT2G20340", "AT2G20420", "AT2G20580", 
"AT2G20610", "AT2G20630", "AT2G20690", "AT2G20760", "AT2G20890", 
"AT2G21060", "AT2G21170", "AT2G21250", "AT2G21270", "AT2G21330", 
"AT2G21370", "AT2G21385", "AT2G21390", "AT2G21470", "AT2G21530", 
"AT2G21590", "AT2G21620", "AT2G21660", "AT2G22230", "AT2G22250", 
"AT2G22400", "AT2G22420", "AT2G22450", "AT2G22480", "AT2G22570", 
"AT2G22780", "AT2G22990", "AT2G23080", "AT2G23350", "AT2G23420", 
"AT2G23600", "AT2G23610", "AT2G23820", "AT2G24020", "AT2G24190", 
"AT2G24200", "AT2G24270", "AT2G24490", "AT2G24580", "AT2G25070", 
"AT2G25080", "AT2G25280", "AT2G25355", "AT2G25450", "AT2G25605", 
"AT2G25830", "AT2G25840", "AT2G25870", "AT2G25950", "AT2G25970", 
"AT2G26060", "AT2G26080", "AT2G26340", "AT2G26540", "AT2G26590", 
"AT2G26670", "AT2G26730", "AT2G26740", "AT2G26780", "AT2G26830", 
"AT2G26930", "AT2G27020", "AT2G27040", "AT2G27150", "AT2G27190", 
"AT2G27210", "AT2G27360", "AT2G27450", "AT2G27460", "AT2G27530", 
"AT2G27680", "AT2G27820", "AT2G27860", "AT2G27920", "AT2G28000", 
"AT2G28080", "AT2G28100", "AT2G28190", "AT2G28470", "AT2G28605", 
"AT2G28790", "AT2G29290", "AT2G29310", "AT2G29320", "AT2G29340", 
"AT2G29360", "AT2G29400", "AT2G29420", "AT2G29450", "AT2G29550", 
"AT2G29560", "AT2G29630", "AT2G29690", "AT2G29700", "AT2G29730", 
"AT2G30050", "AT2G30060", "AT2G30110", "AT2G30140", "AT2G30150", 
"AT2G30170", "AT2G30200", "AT2G30320", "AT2G30410", "AT2G30520", 
"AT2G30695", "AT2G30710", "AT2G30860", "AT2G30870", "AT2G30970", 
"AT2G31170", "AT2G31240", "AT2G31390", "AT2G31570", "AT2G31610", 
"AT2G31670", "AT2G31750", "AT2G31790", "AT2G31810", "AT2G32060", 
"AT2G32080", "AT2G32170", "AT2G32230", "AT2G32240", "AT2G32410", 
"AT2G32500", "AT2G32520", "AT2G32730", "AT2G33150", "AT2G33210", 
"AT2G33255", "AT2G33410", "AT2G33590", "AT2G33740", "AT2G33800", 
"AT2G34040", "AT2G34470", "AT2G34510", "AT2G34630", "AT2G34680", 
"AT2G34790", "AT2G34810", "AT2G35010", "AT2G35020", "AT2G35040", 
"AT2G35120", "AT2G35370", "AT2G35410", "AT2G35450", "AT2G35490", 
"AT2G35500", "AT2G35635", "AT2G35690", "AT2G35780", "AT2G35810", 
"AT2G35820", "AT2G35830", "AT2G35840", "AT2G35860", "AT2G36060", 
"AT2G36160", "AT2G36230", "AT2G36250", "AT2G36310", "AT2G36390", 
"AT2G36460", "AT2G36530", "AT2G36580", "AT2G36800", "AT2G36880", 
"AT2G36970", "AT2G37020", "AT2G37040", "AT2G37220", "AT2G37240", 
"AT2G37270", "AT2G37500", "AT2G37550", "AT2G37660", "AT2G37680", 
"AT2G37760", "AT2G37790", "AT2G38040", "AT2G38230", "AT2G38270", 
"AT2G38390", "AT2G38540", "AT2G38700", "AT2G38710", "AT2G38740", 
"AT2G38860", "AT2G39020", "AT2G39080", "AT2G39310", "AT2G39550", 
"AT2G39730", "AT2G39770", "AT2G39780", "AT2G39795", "AT2G39800", 
"AT2G39940", "AT2G39990", "AT2G40060", "AT2G40290", "AT2G40300", 
"AT2G40490", "AT2G40550", "AT2G40600", "AT2G40660", "AT2G40730", 
"AT2G40840", "AT2G40880", "AT2G41220", "AT2G41350", "AT2G41530", 
"AT2G41680", "AT2G41740", "AT2G41760", "AT2G41790", "AT2G41950", 
"AT2G42070", "AT2G42130", "AT2G42230", "AT2G42490", "AT2G42500", 
"AT2G42520", "AT2G42530", "AT2G42540", "AT2G42590", "AT2G42600", 
"AT2G42620", "AT2G42790", "AT2G42810", "AT2G42910", "AT2G43030", 
"AT2G43070", "AT2G43090", "AT2G43100", "AT2G43120", "AT2G43235", 
"AT2G43360", "AT2G43560", "AT2G43570", "AT2G43710", "AT2G43750", 
"AT2G43760", "AT2G43770", "AT2G43790", "AT2G43810", "AT2G43820", 
"AT2G43840", "AT2G43910", "AT2G43940", "AT2G43945", "AT2G43980", 
"AT2G44040", "AT2G44050", "AT2G44100", "AT2G44120", "AT2G44160", 
"AT2G44350", "AT2G44490", "AT2G44580", "AT2G44610", "AT2G44650", 
"AT2G44760", "AT2G44920", "AT2G45030", "AT2G45240", "AT2G45270", 
"AT2G45290", "AT2G45300", "AT2G45440", "AT2G45470", "AT2G45540", 
"AT2G45600", "AT2G45710", "AT2G45730", "AT2G45790", "AT2G45810", 
"AT2G45990", "AT2G46110", "AT2G46280", "AT2G46370", "AT2G46520", 
"AT2G46580", "AT2G47250", "AT2G47390", "AT2G47400", "AT2G47450", 
"AT2G47470", "AT2G47510", "AT2G47610", "AT2G47730", "AT2G47790", 
"AT2G47910", "AT2G47940", "AT2G47960", "AT2G47970", "AT2G48120", 
"AT3G01120", "AT3G01310", "AT3G01340", "AT3G01440", "AT3G01480", 
"AT3G01500", "AT3G01510", "AT3G01520", "AT3G01590", "AT3G01640", 
"AT3G01780", "AT3G01980", "AT3G02080", "AT3G02230", "AT3G02260", 
"AT3G02320", "AT3G02360", "AT3G02520", "AT3G02530", "AT3G02540", 
"AT3G02570", "AT3G02630", "AT3G02660", "AT3G02720", "AT3G02730", 
"AT3G02740", "AT3G02760", "AT3G02770", "AT3G02780", "AT3G02830", 
"AT3G02870", "AT3G02880", "AT3G03250", "AT3G03380", "AT3G03570", 
"AT3G03610", "AT3G03710", "AT3G03750", "AT3G03780", "AT3G03890", 
"AT3G03960", "AT3G03980", "AT3G03990", "AT3G04000", "AT3G04120", 
"AT3G04290", "AT3G04400", "AT3G04480", "AT3G04520", "AT3G04550", 
"AT3G04600", "AT3G04610", "AT3G04650", "AT3G04720", "AT3G04780", 
"AT3G04790", "AT3G04820", "AT3G04840", "AT3G04870", "AT3G04880", 
"AT3G04920", "AT3G04940", "AT3G05155", "AT3G05180", "AT3G05350", 
"AT5G28020", "AT5G28030", "AT5G28050", "AT5G28500", "AT5G28830", 
"AT5G28840", "AT5G28900", "AT5G30510", "AT5G32450", "AT5G32470", 
"AT5G34850", "AT5G35100", "AT5G35170", "AT5G35360", "AT5G35430", 
"AT5G35590", "AT5G35620", "AT5G35630", "AT5G35680", "AT5G35700", 
"AT5G35790", "AT5G36160", "AT5G36170", "AT5G36210", "AT5G36230", 
"AT5G36790", "AT5G36880", "AT5G36890", "AT5G37210", "AT5G37510", 
"AT5G37600", "AT5G37830", "AT5G37850", "AT5G38420", "AT5G38430", 
"AT5G38470", "AT5G38480", "AT5G38530", "AT5G38830", "AT5G39050", 
"AT5G39080", "AT5G39320", "AT5G39570", "AT5G39590", "AT5G39730", 
"AT5G39740", "AT5G39830", "AT5G40190", "AT5G40280", "AT5G40370", 
"AT5G40390", "AT5G40440", "AT5G40450", "AT5G40610", "AT5G40660", 
"AT5G40760", "AT5G40850", "AT5G40950", "AT5G41210", "AT5G41310", 
"AT5G41330", "AT5G41480", "AT5G41670", "AT5G41950", "AT5G41970", 
"AT5G42020", "AT5G42100", "AT5G42250", "AT5G42390", "AT5G42650", 
"AT5G42720", "AT5G42740", "AT5G42760", "AT5G42765", "AT5G42770", 
"AT5G42790", "AT5G42970", "AT5G42980", "AT5G43060", "AT5G43070", 
"AT5G43280", "AT5G43330", "AT5G43400", "AT5G43430", "AT5G43600", 
"AT5G43830", "AT5G43940", "AT5G43960", "AT5G44070", "AT5G44130", 
"AT5G44320", "AT5G44340", "AT5G44400", "AT5G44410", "AT5G44500", 
"AT5G44520", "AT5G44600", "AT5G44720", "AT5G44730", "AT5G45020", 
"AT5G45170", "AT5G45280", "AT5G45390", "AT5G45620", "AT5G45775", 
"AT5G45900", "AT5G45930", "AT5G45940", "AT5G46070", "AT5G46180", 
"AT5G46290", "AT5G46390", "AT5G46420", "AT5G46580", "AT5G46630", 
"AT5G46790", "AT5G47200", "AT5G47210", "AT5G47435", "AT5G47650", 
"AT5G63840", "AT5G63860", "AT5G63890", "AT5G63980", "AT5G63990", 
"AT5G64050", "AT5G64110", "AT5G64250", "AT5G64300", "AT5G64350", 
"AT5G64380", "AT5G64460", "AT5G64570", "AT5G64620", "AT5G64830", 
"AT5G64860", "AT5G65010", "AT5G65430", "AT5G65620", "AT5G65720", 
"AT5G65730", "AT5G65750", "AT5G65760", "AT5G65780", "AT5G65840", 
"AT5G65940", "AT5G66030", "AT5G66040", "AT5G66090", "AT5G66120", 
"AT5G66140", "AT5G66190", "AT5G66470", "AT5G66530", "AT5G66550", 
"AT5G66570", "AT5G66720", "AT5G66760", "AT5G67150", "AT5G67360", 
"ATCG00120", "ATCG00160", "ATCG00170", "ATCG00190", "ATCG00380", 
"ATCG00470", "ATCG00480", "ATCG00490", "ATCG00500", "ATCG00650", 
"ATCG00660", "ATCG00670", "ATCG00750", "ATCG00770", "ATCG00780", 
"ATCG00800", "ATCG00810", "ATCG00820", "ATCG01090", "ATCG01110", 
"ATCG01120", "ATCG01240", "ATCG01300", "ATCG01310", "ATMG01190"
), class = "factor"), X1_1 = c(0, 0, 0, 0, 0, 0), X1_2 = c(0, 
0, 0, 0, 0, 0), X1_3 = c(0, 1, 0, 0, 0, 0), X1_4 = c(0, 0.660693687777888, 
0, 0, 0, 0), X1_5 = c(0, 0.521435654491704, 0, 0, 0, 1), X1_6 = c(0, 
0.437291194705566, 0, 0, 0, 1), X1_7 = c(0, 0.52204783488213, 
0, 0, 0, 0), X1_8 = c(0, 0.524298383907171, 0, 0, 0, 0), X1_9 = c(1, 
0.376865096972469, 0, 1, 0, 0), X1_10 = c(0, 0, 0, 0, 0, 0), 
    X1_11 = c(0, 0, 0, 0, 0, 0), X1_12 = c(0, 0, 0, 0, 0, 0), 
    X1_13 = c(0, 0, 0, 0, 0, 0), X1_14 = c(0, 0, 0, 0, 0, 0), 
    X1_15 = c(0, 0, 0, 0, 0, 0), X1_16 = c(0, 0, 0, 0, 0, 0), 
    X1_17 = c(0, 0, 0, 0, 0, 0), X1_18 = c(0, 0, 0.476101907006443, 
    0, 0, 0), X1_19 = c(0, 0, 1, 0, 0, 0), X1_20 = c(0, 0, 0, 
    0, 0, 0), X1_21 = c(0, 0, 0, 0, 1, 0), X1_22 = c(0, 0, 0, 
    0, 0, 0), X1_23 = c(0, 0, 0, 0, 0, 0), X1_24 = c(0, 0, 0, 
    0, 0, 0)), .Names = c("Gene.name", "X1_1", "X1_2", "X1_3", 
"X1_4", "X1_5", "X1_6", "X1_7", "X1_8", "X1_9", "X1_10", "X1_11", 
"X1_12", "X1_13", "X1_14", "X1_15", "X1_16", "X1_17", "X1_18", 
"X1_19", "X1_20", "X1_21", "X1_22", "X1_23", "X1_24"), row.names = c(NA, 
6L), class = "data.frame")

我希望通过行名从这个数据框中选择行。我创建了一个矢量:

> vec_pTCA
 [1] "AT1G01090" "AT1G04410" "AT1G09430" "AT1G10670" "AT1G24180" "AT1G30120"
 [7] "AT1G34430" "AT1G48030" "AT1G53240" "AT1G54220" "AT1G59900" "AT1G65930"
[13] "AT2G05710" "AT2G17130" "AT2G20420" "AT2G22780" "AT2G42790" "AT2G44350"
[19] "AT2G47510" "AT3G06650" "AT3G09810" "AT3G13930" "AT3G15020" "AT3G16950"
[25] "AT3G17240" "AT3G27380" "AT3G47520" "AT3G52200" "AT3G55410" "AT4G16155"
[31] "AT4G26910" "AT4G26970" "AT4G35260" "AT4G35830" "AT4G37870" "AT5G03290"
[37] "AT5G08300" "AT5G09660" "AT5G14590" "AT5G43330" "AT5G49460" "AT5G50850"
[43] "AT5G50950" "AT5G55070" "AT5G65750" "AT5G66760"

如何轻松选择特定行并将值保留在其余列中?

今天感觉完全愚蠢。

1 个答案:

答案 0 :(得分:2)

您可以使用%in%以及[基本提取:

tbl_ready[tbl_ready$Gene.name %in% vec_pTCA, ]
#   Gene.name X1_1 X1_2 X1_3 X1_4 X1_5 X1_6 X1_7 X1_8 X1_9 X1_10 X1_11 X1_12 X1_13
# 3 AT1G01090    0    0    0    0    0    0    0    0    0     0     0     0     0
#   X1_14 X1_15 X1_16 X1_17     X1_18 X1_19 X1_20 X1_21 X1_22 X1_23 X1_24
# 3     0     0     0     0 0.4761019     1     0     0     0     0     0