Forums | OpenR

OpenR: R & Statistics /
question about layout function


Ziyu Yuan's profile picture
Posts: 2

13 March 2023, 6:06 PM

mymat1 <- matrix(c(1,3:5),nrow = 2)
layout(mat = mymat1,widths = c(1,1,2),heights = c(1,2))

plot(airquality$Solar.R, airquality$Ozone)
hist(airquality$Solar.R)
barplot(airquality$Month)
plot(airquality$Solar.R, airquality$Ozone)

--------

above is my code, and I find that there exists a mistake that "格式矩阵至少要对{1 ... 5}里每一个值都有参考值" when running the second line.

what does it mean? what is "matrix(c(1,3:5))" stand for?

 

Peng Zhao's profile picture
Posts: 128

13 March 2023, 8:32 PM

I don't think you can skip 2 from c(1, 3:5), and you give 3 widths for 2 columns.

Ziyu Yuan's profile picture
Posts: 2

14 March 2023, 12:02 AM

thanks for reply, i get it.

3 results