这个我也没法明白,期待高人帮忙!
看一下下面的命令能否发现什么规律吗?
set.seed(1410) # Make the sample reproducible
dsmall <- economics[sample(nrow(economics),
5), ]
year <- function(x) as.POSIXlt(x)$year + 1900
qplot(unemploy / pop, uempmed, data = dsmall,
geom = "path", colour = year(date)) + scale_area()
上述命令生成图1,
set.seed(1410) # Make the sample reproducible
dsmall <- economics[sample(nrow(economics),
100), ]
year <- function(x) as.POSIXlt(x)$year + 1900
qplot(unemploy / pop, uempmed, data = dsmall,
geom = "path", colour = year(date)) + scale_area()
上述命令生成图2,