r - Make scatter plots for multiple subsets of data -
I should present my data set and my initial results to better understand your question. My dataset looks like this:
place species size Conc BT 24 0.2 AST 76 1.4 ... B BT 45 1.2 BST 21 0.7 ...
every
. What I've done uses species
against each location
against size
me. For ggplot2
to create a graph as below:
scatterplot
However, in different groups of this graph, It summarizes all the data in the dataset and fails to plot for different locations.
I think the code below
scatterplot
just place Work for plotting A
And I can do it for different places one by one. However, in my actual dataset, there are many different places in the location variable, and I can not type them all manually one by one. In this way my question is actually how to automatically make those plots for different places once?
Try:
ggplot (ddf) + geom_point (AES size, conc.) ) + Facet_grid (Place ~ Species)
Or, in a graph:
ggplot (ddf) + geom_point (AES (size, conc., Color = place, size = species), size = 5)
Comments
Post a Comment