を選択:私は文字Cで終わるsample_idsだけでなく、TARGET_IDを選択するためにdplyrの選択機能を使用したいDplyrは、私はこのようになりますDF始まるよends_with
sample_id target_id length eff_length est_counts tpm class
1 SRR3884838C (A)n 69 70 0 0.00000 0
2 SRR3884838C (AC)n 69 70 0 0.00000 0
3 SRR3884838C (AG)n 69 70 0 0.00000 0
4 SRR3884838C (AT)n 69 70 5 15.98870 0
とtpm。
例データ:私sample_id、TARGET_IDとTPMを与えるが、Cの例で終わるだけsample_id年代を選択しない
teC <- select(te, (sample_id, ends_with("C")), target_id, tpm)
:
> dput(droplevels(head(te,4)))
structure(list(sample_id = structure(c(1L, 1L, 1L, 1L), .Label = "SRR3884838C", class = "factor"),
target_id = structure(1:4, .Label = c("(A)n", "(AC)n", "(AG)n",
"(AT)n"), class = "factor"), length = c(69L, 69L, 69L, 69L
), eff_length = c(70L, 70L, 70L, 70L), est_counts = c(0,
0, 0, 5), tpm = c(0, 0, 0, 15.9887), class = c(0L, 0L, 0L,
0L)), .Names = c("sample_id", "target_id", "length", "eff_length",
"est_counts", "tpm", "class"), row.names = c(NA, 4L), class = "data.frame")
は、私は、次の使用してみました
sample_id target_id tpm
9759 SRR3884843CxS Tigger15a 0.00000e+00
9760 SRR3884843CxS Tigger16a 0.00000e+00
9761 SRR3884843CxS Tigger16b 0.00000e+00
selectで何か間違っていますか?チュートリアルサイトのサンプルデータを問題なく扱うことができました。あなたがsample_id
、target_id
、およびtmp
でやっていることである名前、によって:
いつ 'sample_id'が' 'C" 'で終わるでしょうか?例を教えてください。 – CPak
コードの最初のブロックには、他のエンディング(CxSなど)の代わりにCで終わる例がありますが、意味がありますか?もっと明確にする必要がある場合は、私にお知らせください。 – ZincFingers