I'm trying to use ddply
in a data frame (created using melt
) as the following:
head(MoP_top50_ftrt_htmp_melt)
Taxon variable value
1 K03406; methyl-accepting chemotaxis protein Coal 0.2748281
2 K02014; iron complex outermembrane recepter protein Coal 0.2676633
3 K03296; hydrophobic/amphiphilic exporter-1 (mainly G- bacteria), HAE1 family Coal 0.2516787
4 K06147; ATP-binding cassette, subfamily B, bacterial Coal 0.2592270
5 K00936; [EC:2.7.3.-] Coal 0.2278227
6 K08300; ribonuclease E [EC:3.1.26.12] Coal 0.2528503
And I'm trying to get it ready to ggplot2
with proportions included.
For that I'm using:
require(plyr)
MoP_top50_ftrt_htmp_melt <- ddply(MoP_top50_ftrt_htmp_melt, .(sample), transform, value=(value/sum(value))*100)
But getting this error:
Error in unique.default(x) : unique() applies only to vectors
Does this have to do with the semicolons and spaces in the Taxon column?