# R program to illustrate# dim function# Getting R Biochemical Oxygen Demand Dataset
BOD
# Getting dimension of the above dataset
dim(BOD)
R
输出
Time demand
118.32210.33319.04416.05515.66719.8[1]62
R
例2 :
# R program to illustrate# dim function# Getting the number from 1 to 9
x <- rep(1:9)
x
# Calling the dim() function to# Set dimension of 3 * 3
dim(x)<- c(3,3)# Getting the numbers# in 3 * 3 representation
x