嗨,我有以下的代碼,我使用的大容量包裝R中轉換一個序列圖到動畫序列
library(MASS)
library(ggplot2)
for(x in 0:100){
mycor = x/100
mydist = mvrnorm(100, c(5,10), matrix(c(1,mycor,mycor,1), 2),
empirical=TRUE)
md = data.frame(mydist)
colnames(md)= c('x','y')
graph = ggplot(md, aes(x,y)) + geom_point() +
stat_smooth(method='lm',color='red') +
stat_smooth(method='loess',se=FALSE,color='blue')
print(graph)
Sys.sleep(0.05)
}
查看協方差矩陣的行爲,這將如果我能成爲偉大將快照轉換爲動畫序列。有什麼方法可以用R來做到這一點?
感謝
是6pool感謝 –