# NOT RUN {
library(metan)
# One-way line plot
df1 <- data.frame(group = "A",
x = c(0, 100, 200, 300, 400),
y = c(3.2, 3.3, 4.0, 3.8, 3.4))
plot_lines(df1, x, y, fit = 2)
# Two-way line plot
df2 <- data.frame(group = "B",
x = c(0, 100, 200, 300, 400),
y = c(3.2, 3.3, 3.7, 3.9, 4.1))
facts <- rbind(df1, df2)
p1 <- plot_factlines(facts, x, y, group = group, fit = 1)
p2 <- plot_factlines(facts,
x = x,
y = y,
group = group,
fit = c(2, 1),
confidence = FALSE)
arrange_ggplot(p1, p2)
# }
Run the code above in your browser using DataLab