-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2347234_r_pre.R
30 lines (20 loc) · 1.11 KB
/
2347234_r_pre.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
# Load the data
data <- read.csv("updated_file.csv")
# Descriptive statistics
summary(data)
# Check for missing or non-numeric values in the "IT" column
missing_values <- sum(is.na(data$IT) | !is.numeric(data$IT))
if (missing_values > 0) {
# If there are missing or non-numeric values, print a message and handle them
cat("Warning: Missing or non-numeric values found in the 'IT' column. Handling missing values.\n")
# Replace missing or non-numeric values with a default value (e.g., 0)
data$IT[!is.numeric(data$IT)] <- 0
}
# Scatter plot for Age and IT with color
plot(data$Age, data$IT, main = "Scatter Plot of Age and IT", xlab = "Age", ylab = "IT", col = "red", pch = 16)
# Scatter plot for Age with color
plot(data$Age, main = "Scatter Plot of Age", xlab = "Age", col = "green", pch = 16)
# Scatter plot for Age and Income with color
#plot(data$Age, data$Income, main = "Scatter Plot of Age and Income", xlab = "Age", ylab = "Income", col = "blue", pch = 16)
# Scatter plot for Age and IT with color
#plot(data$Age, data$IT, main = "Scatter Plot of Age and IT", xlab = "Age", ylab = "IT", col = "red", pch = 16)