首页 > 解决方案 > R行命令不在lineplot中添加行

问题描述

当试图在 R 上运行我的代码时,它运行并产生了一半的工作。lines 命令没有添加所需的第二行,我不明白为什么。感谢您的帮助!代码:

Forceps <- c(6.61, 4.87, 3.23, 2.00, 1.29, 0.98)
Vacuum <- c(5.05, 7.21, 7.66, 5.93, 5.45, 4.40)
year <- c(1990, 1994, 1998, 2002, 2006, 2010)
plot(year, Forceps, type = "l", xlab = "Year", ylab = "Frequency", main = "Forceps (black) vs Vacuum (red) ", ylim = c(0,10))
lines(year, Vacuum, col = "red”)

标签: r

解决方案


推荐阅读