gpt4 book ai didi

r - R中的autoplot函数和plot函数有什么区别

转载 作者:行者123 更新时间:2023-12-05 06:30:24 27 4
gpt4 key购买 nike

这两个函数有什么区别

plot(AP,xlab="Date", ylab = "Passenger numbers (1000's)",main="Air Passenger numbers from 1949 to 1961")

autoplot(AP) + labs(x ="Date", y = "Passenger numbers (1000's)", title="Air Passengers from 1949 to 1961")

最佳答案

从图形数据表示的角度来看,graphics::plotggplot2::autoplot + ggfortify 没有太大区别时间序列绘图包。如果您开始绘制更复杂的图(分面、多图、分组等),差异将很明显。至于你的问题,请看下面:

图形::绘图:

data(AirPassengers)
AP <- AirPassengers
plot(AP, xlab="Date", ylab = "Passenger numbers (1000's)", main = "Air Passenger data, base")

base

ggplot2::autoplot:

library(ggplot2)
library(ggfortify)
data(AirPassengers)
AP <- AirPassengers

autoplot(AP) +
labs(x ="Date", y = "Passenger numbers (1000's)", title = "Air Passengers from, ggplot2")

enter image description here

关于r - R中的autoplot函数和plot函数有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52398933/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com