Entering edit mode
4.1 years ago
zizigolu
★
4.3k
Hello
I have patient IDs in one column and if a given mutation is clonal or sub clonal like
SampleID Mutation
A Clonal
A Clonal
A Clonal
A Subclonal
A Subclonal
A Subclonal
A Clonal
A Clonal
B Clonal
B Clonal
B subclonal
C subclonal
C clonal
Here, sample A has 5 clonal and 3 sub clonal mutations, sample B has 2 clonal and 1 sub-clonal mutations and sample C has 1 clonal and 1 sub clonal mutation
I want to write this like
SampleID Clonal Subclonal
A 5 3
B 2 1
C 1 1
Do you know how I can do that in R?
Thank you
You may be able to use table function in R.
https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/table
Thank you Fatemeh Jan, unfortunately I am too poor in coding and I only have one column either clonal or sub-clonal
@ rpolicastro thanks a million