My data looks like this
PDB.ID Chain.ID Space.Group Uniprot.Recommended.Name
101M A P 6 Myoglobin
102L A P 32 2 1 Endolysin
102M A P 6 Myoglobin
103L A P 32 2 1 Endolysin
103M A P 6 Myoglobin
104L A H 3 2 Endolysin
After reading the data and loading the required package
df <- read.delim("~/Downloads/dummy2.tsv")
library(dplyr)
I can count the number of entries for a specific variable with code like this
df %>% count(Uniprot.Recommended.Name)
Or alternatively
df %>% +
group_by(Uniprot.Recommended.Name) %>% +
summarise( +
count = n() +
)
I get two columns, a count for every case of Uniprot.Recommended.Name
My question: Is it possible to get a table with two counts. Counting the number of entries for every Space.Group
per Uniprot.Recommended.Name
.
Expected table should be like something like this
Myoglobin P 6 123
Myoglobin P 32 2 1 124
Endolysin P 32 2 1 125
Endolysin H 3 2 126
Thanks