Professional Documents
Culture Documents
Affan WS1 Screenshots
Affan WS1 Screenshots
Affan WS1 Screenshots
1. Define your data: First, you define your data as a vector of rainfall values
Rainfall_data<-c(1,3,4,3,7,2,3,2,9,5,10,5,6,5,7,8,5)
2. Use the hist() function: To create a histogram of your data, you used the hist()
function. This function takes several arguments that allow you to customize
ylab="Frequency",xlim=c(1,10),ylim=c(1,7),col="pink",border="blue",bre
aks=10)
3. View your histogram: After running the hist() function, R will create a
histogram of your data using the arguments you specified. You should see a
1. Define your data: First, you created a matrix” rainfall_data” that contains
your data. Each column represents a month and each row represents a
different year. You also created a vector” month_name” that contains the
rainfall_data <- matrix(c(30, 35, 25, 20, 14, 40, 45, 20, 15, 13, 25, 25, 23,
2. Use the boxplot() function: To create a boxplot of your data, you used the
boxplot() function. This function takes several arguments that allow you to
3. View your boxplot: After running the boxplot() function, R will create a
boxplot of your data using the arguments you specified. You should see a
window with your boxplot displayed.