This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Metadata Normalization

how can I normalize my data look like this?

enter image description here

metadata r

You should put more effort into your questions, otherwise we won't be able to help you.

now my data look like this, and also this is the code

ggplot(data=marged_data, aes(x=Sample, y=kraken_assigned_reads, fill=name))+  geom_bar(aes(), stat="identity", position="stack")

Since you didn't provide any of your code I don't know what you did exactly, but you should be able to change geom_bar(position="stack") to geom_bar(position="fill").

This is the head of my data

          name kraken_assigned_reads Sample
 1    Gilliamella             7685     AghB
 2    Lactobacillus           50519    AghB
 3    Bifidobacterium         13518    AghB
 4    Snodgrassella           5273     AghB
 5    Frischella              3124     AghB 
 6    Gilliamella             2205     ArB

Please do not paste screenshots of plain text content, it is counterproductive. You can copy paste the content directly here (using the code formatting option shown below), or use a GitHub Gist if the content volume exceeds allowed length here.

code_formatting

0 answers

No answers yet.

Log in to answer this question.