There are two data frames - df1
& df2
from which I need to create line plot using ggplot2 and display on the same graph.
df1
x y
2 30
4 25
6 20
8 15
df2
x y
2 12
4 16
6 20
8 24
for plotting the first df,
p1 <- ggplot( df1, aes(x = df1[,1] , y = log(df1[,2]) ) )
p1 <- p1 + geom_line(aes(y = log(df1[,2])))
p1
how do we get a same plot overlay on same graph for data frame df2