-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment_4.R
38 lines (20 loc) · 829 Bytes
/
experiment_4.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#dataset <- read.csv("path/to/your/dataset.csv")
dat <- read.csv("C:/Users/prasa/OneDrive/Desktop/DataVisulalization/weather.csv")
dataset <- data.frame(dat)
str(dataset)
head(dataset)
summary(dataset)
subset_data <- dataset[dataset$WindGustSpeed>50,]
print(subset_data)
dataset$new_variable <- dataset$WindGustSpeed*2
filter_data <- subset(dataset,new_variable=='60')
print(filter_data)
# Calculate mean, median, and standard deviation
mean_value <- mean(dataset$Cloud9am)
median_value <- median(dataset$Cloud9am)
sd_value <- sd(dataset$Cloud9am)
table(dataset$Cloud9am)
# Create a histogram for a numeric variable
hist(dataset$Cloud9am, main = "Distribution of Numeric Column", xlab = "1")
# Create a bar plot for a categorical variable0
barplot(table(dataset$RainTomorrow), main = "Frequency of Categories")