print("Initial contents of v1:")
v1 <- c(1,2,NA,4)
print(v1)

print("Updated v2:")
v2 <- replace(v1, is.na(v1), mean(v1, na.rm = TRUE))
print(v2)

print("-----------------------")
print("Initial contents of v3:")
v3 <- c(1,2,NA,4,NA,5,6)
print(v3)

print("Updated v4:")
v4 <- replace(v3, is.na(v3), mean(v3, na.rm = TRUE))
print(v4)

