Hi, can anyone help me in this problem :(. I am a total beginner in R
software. It took me 2 days just to look into this problem. Due to this
problem. I cant do looping. i want to find the distance between x and DSi
i Si
1 1 (5, 20)
2 2 (20, 2)
3 3 (25, 32)
4 4 (8, 39)
5 5 (10, 17)
6 6 (35, 20)
7 7 (38, 10)
'data.frame': 7 obs. of 2 variables:
$ i : int 1 2 3 4 5 6 7
$ Si: Factor w/ 7 levels "(10, 17)","(20, 2)",..: 6 2 3 7 1 4 5
x <- c(15, 45)
y <- DSi [,2]
dist <- function (point1, point2)
+ {
+ diff <- point1-point2
+ distance <- sqrt(sum(diff^2))
+ distance
+ }