yCounts geombaraesfillLevel position dodge statidentity

Ycounts geombaraesfilllevel position dodge

This preview shows page 9 - 22 out of 145 pages.

> ggplot(MTDSSA,aes(x=Year, y=Counts)) + geom_bar(aes(fill=Level), position=" dodge", stat="identity")
Image of page 9
> ggplot(MTDSSA, aes(x=Year, y=Counts, fill=Level)) + geom_bar(stat="identity ")
Image of page 10
Image of page 11
Europe DSEU<-DS[11:15,] > DSEU Region Year X0 X1 X2 X3 X4 X5 Sample.Size 11 Europe 2010 0 0 1 3 7 4 15 12 Europe 2011 0 0 1 2 8 4 15 13 Europe 2012 0 0 1 2 15 7 25 14 Europe 2013 0 0 1 2 21 6 30 15 Europe 2014 0 0 1 4 17 8 30 > TDSEU<-t(DSEU[,3:8]) > TDSEU 11 12 1 3 14 15 X0 0 0 0 0 0 X1 0 0 0 0 0 X2 1 1 1 1 1 X3 3 2 2 2 4 X4 7 8 1 5 21 17 X5 4 4 7 6 8 > colnames(TDSEU)<-c("2010","2011","2012","2013","2014") > TDSEU 2010 2011 2012 2013 2014 X0 0 0 0 0 0 X1 0 0 0 0 0 X2 1 1 1 1 1 X3 3 2 2 2 4 X4 7 8 15 21 17 X5 4 4 7 6 8 > MTDSEU <- melt(TDSEU, id.vars=var1) > MTDSEU X1 X2 value 1 X0 2010 0 2 X1 2010 0 3 X2 2010 1 4 X3 2010 3 5 X4 2010 7 6 X5 2010 4 7 X0 2011 0 8 X1 2011 0 9 X2 2011 1 10 X3 2011 2 11 X4 2011 8 12 X5 2011 4 13 X0 2012 0 14 X1 2012 0 15 X2 2012 1 16 X3 2012 2 17 X4 2012 15 18 X5 2012 7 19 X0 2013 0 20 X1 2013 0 21 X2 2013 1 22 X3 2013 2 23 X4 2013 21 24 X5 2013 6 25 X0 2014 0 26 X1 2014 0
Image of page 12
27 X2 2014 1 28 X3 2014 4 29 X4 2014 17 30 X5 2014 8 > colnames(MTDSEU)<-c("Level","Year","Counts") > MTDSEU 1 Level X0 Year 2010 Counts 0 2 X1 2010 0 3 X2 2010 1 4 X3 2010 3 5 X4 2010 7 6 X5 2010 4 7 X0 2011 0 8 X1 2011 0 9 X2 2011 1 10 X3 2011 2 11 X4 2011 8 12 X5 2011 4 13 X0 2012 0 14 X1 2012 0 15 X2 2012 1 16 X3 2012 2 17 X4 2012 15 18 X5 2012 7 19 X0 2013 0 20 X1 2013 0 21 X2 2013 1 22 X3 2013 2 23 X4 2013 21 24 X5 2013 6 25 X0 2014 0 26 X1 2014 0 27 X2 2014 1 28 X3 2014 4 29 X4 2014 17 30 X5 2014 8 > ggplot(MTDSEU,aes(x=Year, y=Counts)) + geom_bar(aes(fill=Level), position=" dodge", stat="identity")
Image of page 13
> ggplot(MTDSEU, aes(x=Year, y=Counts, fill=Level)) + geom_bar(stat="identity ")
Image of page 14
Image of page 15
Pacific Rim > DSPR<-DS[16:20,] > DSPR Region Year X0 X1 X2 X3 X4 X5 Sample.Size 16 Pacific Ri m 2010 0 0 1 2 2 0 5 17 Pacific Ri m 2011 0 0 1 1 3 0 5 18 Pacific Ri m 2012 0 0 1 1 3 1 6 19 Pacific Ri m 2013 0 0 0 2 5 3 10 20 Pacific Ri m 2014 0 0 1 2 7 2 12 > TDSPR<-t(DSPR[,3:8]) > TDSPR 16 17 18 19 20 X0 0 0 0 0 0 X1 0 0 0 0 0 X2 1 1 1 0 1 X3 2 1 1 2 2 X4 2 3 3 5 7 X5 0 0 1 3 2 > colnames(TDSPR)<-c("2010","2011","2012","2013","2014") > TDSPR 2010 2011 2012 2013 2014 X0 0 0 0 0 0 X1 0 0 0 0 0 X2 1 1 1 0 1 X3 2 1 1 2 2 X4 2 3 3 5 7 X5 0 0 1 3 2 > MTDSPR <- melt(TDSPR, id.vars=var1) > MTDSPR X1 X2 value 1 X0 2010 0 2 X1 2010 0 3 X2 2010 1 4 X3 2010 2 5 X4 2010 2 6 X5 2010 0 7 X0 2011 0 8 X1 2011 0 9 X2 2011 1 10 X3 2011 1 11 X4 2011 3 12 X5 2011 0 13 X0 2012 0 14 X1 2012 0 15 X2 2012 1 16 X3 2012 1 17 X4 2012 3 18 X5 2012 1 19 X0 2013 0 20 X1 2013 0 21 X2 2013 0 22 X3 2013 2 23 X4 2013 5 24 X5 2013 3 25 X0 2014 0
Image of page 16
26 X1 2014 0 27 X2 2014 1 28 X3 2014 2 29 X4 2014 7 30 X5 2014 2 > colnames(MTDSPR)<-c("Level","Year","Counts") > MTDSPR Level Year Counts 1 X0 2010 0 2 X1 2010 0 3 X2 2010 1 4 X3 2010 2 5 X4 2010 2 6 X5 2010 0 7 X0 2011 0 8 X1 2011 0 9 X2 2011 1 10 X3 2011 1 11 X4 2011 3 12 X5 2011 0 13 X0 2012 0 14 X1 2012 0 15 X2 2012 1 16 X3 2012 1 17 X4 2012 3 18 X5 2012 1 19 X0 2013 0 20 X1 2013 0 21 X2 2013 0 22 X3 2013 2 23 X4 2013 5 24 X5 2013 3 25 X0 2014 0 26 X1 2014 0 27 X2 2014 1 28 X3 2014 2 29 X4 2014 7 30 X5 2014 2 > ggplot(MTDSPR,aes(x=Year, y=Counts)) + geom_bar(aes(fill=Level), position=" dodge", stat="identity")
Image of page 17
> ggplot(MTDSPR, aes(x=Year, y=Counts, fill=Level)) + geom_bar(stat="identity ")
Image of page 18
Image of page 19
China > DSCA<-DS[21:23,] > DSCA Region Year X0 X1 X2 X3 X4 X5 Sample.Size 21 China 2012 0 0 0 1 0 0 1 22 China 2013 0 0 1 4 2 0 7 23 China 2014 0 0 1 5 8 2 16 > TDSCA<-t(DSCA[,3:8]) > TDSCA 21 22 23 X0 0 0 0 X1 0 0 0 X2 0 1 1 X3 1 4 5 X4 0 2 8 X5 0 0 2 > colnames(TDSCA)<-c("2012","2013","2014") > TDSCA 2012 2013 2014 X0 0 0 0 X1 0 0 0 X2 0 1 1 X3 1 4 5 X4 0 2 8 X5 0 0 2 > MTDSCA <- melt(TDSCA, id.vars=var1) > MTDSCA X1 X2 value 1 X0 2012 0 2 X1 2012 0 3 X2 2012 0 4 X3 2012 1 5 X4 2012 0 6 X5 2012 0 7 X0 2013 0 8 X1 2013 0 9 X2 2013 1 10 X3 2013 4 11 X4 2013 2 12 X5 2013 0 13 X0 2014 0 14 X1 2014 0 15 X2 2014 1 16 X3 2014 5 17 X4 2014 8 18 X5 2014 2 > colnames(MTDSCA)<-c("Level","Year","Counts") > MTDSCA 1 Level X0 Year 2012 Counts 0 2 X1 2012 0 3 X2 2012 0 4 X3 2012 1 5 X4 2012 0 6 X5 2012 0 7 X0 2013 0 8 X1 2013 0
Image of page 20
9 X2 2013 1 10 X3 2013
Image of page 21
Image of page 22

You've reached the end of your free preview.

Want to read all 145 pages?

  • Fall '17

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes