R - Programming project on "Rainfall Record"
# Source code
# RAINFALL RECORD PROJECT
# 1.Read Data...
data <- data.frame(
sr.no = c(1:10),
year = c(2011:2020),
time = c(5,10,15,20,25,30,35,40,45,50),
mm = c(21,22,23,24,25,26,27,28,29,30),
stringsAsFactors = FALSE)
print(data)
# Display data using head...
head(data)
#structure data
Str(data)
# 2. Display summary of data...
summary(data)
print(head(data))
# 3.display of important col
print(ncol(data))
print(nrow(data))
# 4.create histogram...
hist(x = data$time,xlab = "time",
col = "black",
border = "orange",
breaks = 5,)
# 5.create piechart and 3D pie chart...
pie(data$year,data$time,col = rainbow(length(data$sr.no)),main = "piechart")
# 3D pie chart
pie3D(data$mm,labels = data$time,explode = 0.1,main = "Rainfall record 3D pie chart")
# 6.create boxplot
boxplot(data$mm, data$time,
xlab = "Year",
ylab = "Time",
main = "Rainfall Record")
# 7.Create a scatterplot...
plot(x = data$year,y = data$time,
xlab = "year",
ylab = "rainfall",
xlim = c(2011,2020),
ylim = c(5,50),
main = "Rainfall Record"
)
# 8.create a bar chart
barplot(data$mm,data$time,
xlab = "years",
ylab = "time in hour",
main = "Rainfall",
border = "black")
# 9.Create a line graph
plot(data$year,type = "o")
Comments
Post a Comment