在R图形窗口中组合基础图形和ggplot图形
我想生成一个具有基本图形和ggplot图形组合的图形。以下代码使用R的基本绘图功能显示了我的身影: t <- c(1:(24*14)) P <- 24 A <- 10 y <- A*sin(2*pi*t/P)+20 par(mfrow=c(2,2)) plot(y,type = "l",xlab = "Time (hours)",ylab = "Amplitude",main = "Time series") acf(y,main = "Autocorrelation",xlab = "Lag (hours)", ylab = "ACF") spectrum(y,method = "ar",main = "Spectral density function", xlab = "Frequency (cycles per hour)",ylab = "Spectrum") require(biwavelet) …