Want to make a plot for my data set

So I have a dataset that I am trying to plot and everything shows up except my data. The plot itself is made with the correct parameters I want excpet my data isn't there. My data table is listed below. And a photo of what running this code gives me.

And the code I used is this...

ggplot(Ecology_Project_Data, aes(x = Ecology_Project_Data$`Zebra Mussel growth rate (dN/dt)`, y = Ecology_Project_Data$`Salmon Growth rate (dN/dt)` )) +
+   labs(x = "Zebra Mussel Growth Rate (dN/dt)", y = "King Salmon Growth Rate (dN/dt)" , title = "Growth Rate of King Salmon Realtive to Zebra Mussel Growth Rate (Lake Michigan 1992-2018)")
Year Salmon Growth rate (dN/dt) Zebra Mussel growth rate (dN/dt)
1992 330 156,333.60
1993 330.2 262,754.23
1994 294.6 334,895.69
1995 294.1 397,149.43
1996 290.7 448,196.76
1997 291.8 492,592.94
1998 289.1 574,502.47
1999 288.4 632,498.25
2000 288.4 671,261.19
2001 290.6 721,156.32
2002 287.9 796,842.57
2003 282.4 881,128.22
2004 280.3 885,234.76
2005 270.1 894,673.30
2006 266.2 897,749.51
2007 264.7 902,264.32
2008 262.4 907,483.85
2009 255.5 909,946.97
2010 240.4 908,345.29
2011 233.9 908,557.26
2012 221.3 912,298.51
2013 220.3 914,511.39
2014 218.2 914,789.77
2015 218.1 922,568.55
2016 210.3 925,218.21
2017 212.14 927,164.29
2018 204.3 929,128.36

What you're missing is a geom_* call.

If you use ggplot2, you need to add a call to geom_line, or geom_point, or one of the many other options. In the first call to ggplot functions, you're registering the variables you want to use. Then in these geom_* calls, yoou'll actually plot the data in the way you want.

Hope this helps.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Thank you! I did just like you said and my data showed up!