线性图形
Linear graphics
我有这样一个数据集:
maximum <- c(10) #for each time
minim <- c(2) #for each time
Quantity c(4, 2, 10, 2, 10, 6, 2)
如何构造我的数据集以创建这样的线性图形?时间总是恒定的,除非你从 2 到 10(它们在同一时刻)
使用基础 R plot
函数,只需创建一个时间向量 (x-axis):
maximum <- c(10) #for each time
minim <- c(2) #for each time
Time <- c(1, 2, 2, 3, 3, 4, 5)
Quantity <-c(4, 2, 10, 2, 10, 6, 2)
plot(Time, Quantity, type = "l", col = "lightblue", xaxt = "n")
abline(h = maximum, col = "darkblue")
abline(h = minim, col = "orange")
我有这样一个数据集:
maximum <- c(10) #for each time
minim <- c(2) #for each time
Quantity c(4, 2, 10, 2, 10, 6, 2)
如何构造我的数据集以创建这样的线性图形?时间总是恒定的,除非你从 2 到 10(它们在同一时刻)
使用基础 R plot
函数,只需创建一个时间向量 (x-axis):
maximum <- c(10) #for each time
minim <- c(2) #for each time
Time <- c(1, 2, 2, 3, 3, 4, 5)
Quantity <-c(4, 2, 10, 2, 10, 6, 2)
plot(Time, Quantity, type = "l", col = "lightblue", xaxt = "n")
abline(h = maximum, col = "darkblue")
abline(h = minim, col = "orange")