4
I have 2 data frames for males and another for females (the variables are the same, crc
and maxilla
). From each of these df generated two charts. Now I’m trying to combine them into just one chart, but as they have number of different lines I can’t do.
The df are as follows::
alometria_M_max = (data.frame(crc_M, maxilla_M))
crc_M maxilla_M
1 5.897154 1.398717
2 6.102559 1.560248
3 6.173786 1.640937
4 6.001415 1.515127
5 5.926926 1.388791
6 5.926926 1.458615
7 5.863631 1.558145
8 5.960232 1.528228
9 5.880533 1.437463
10 6.082219 1.547563
11 5.973810 1.521699
12 5.918894 1.458615
13 5.855072 1.423108
14 5.808142 1.283708
alometria_F_max = (data.frame(crc_F, maxilla_F))
crc_F maxilla_F
1 6.198479 1.576915
2 6.295266 1.701105
3 6.418365 1.884035
4 6.393591 1.818077
5 6.120297 1.665818
6 6.142037 1.633154
7 6.139885 1.615420
8 5.855072 1.543298
9 5.913503 1.665818
10 6.165418 1.479329
11 6.107023 1.607436
12 6.214608 1.710188
13 6.171701 1.684545
Graphics
plot_M <- ggplot(alometria_M_max, aes(x=crc_M, y= maxilla_M)) +
geom_point(color="green") +
theme_bw() +
theme_classic() +
geom_smooth(method = "lm", se= FALSE, color= "green")
plot_F <- ggplot(alometria_F_max, aes(x=crc_F, y= maxilla_F)) +
geom_point(color="red") +
theme_bw() +
theme_classic() +
geom_smooth(method = "lm", se= FALSE, color= "red")
Will someone please have an idea of how to put these two graphs together in just one, with the regression slope lines visible?
Marcus, thank you so much, it worked out great. Thanks so much.
– Marina Santos
It’s great to know that my response has helped you in some way. So consider vote and accept the answer, so that in the future other people who experience the same problem have a reference to solve it.
– Marcus Nunes
Ahh, ok Marcus, I already voted and accepted, as I’m new around here I took a little while to see how it works, but now it’s gone. Thanks again.
– Marina Santos
No problem. The important thing is that we help ourselves here in the community : )
– Marcus Nunes