-
Notifications
You must be signed in to change notification settings - Fork 0
/
Code #1
43 lines (29 loc) · 930 Bytes
/
Code #1
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
39
x <- 1:1000
y <- 1:1000
east <- sample(x, size = 50, replace = TRUE)
north <- sample(y, size = 50, replace = TRUE)
symbols(east, north, squares = rep(7.5,50), inches = FALSE)
symbols(sample(x, 40, replace = TRUE),
sample(y, 40, replace = TRUE),
circles = rep(7.5,40),
inches = FALSE,
fg = "green",
add = TRUE)
symbols(sample(x, 12, replace = TRUE),
sample(y, 12, replace = TRUE),
circles = rep(15,12),
inches = FALSE,
fg = "green4",
bg = "beige",
add = TRUE)
dwellings <- cbind.data.frame(id = 1:50, east, north)
locs <- sample(1:50, 7, replace = FALSE)
text(x = dwellings[locs, 2],
y = dwellings[locs, 3] + 7,
labels = dwellings[locs, ]$id)
xspline(x = dwellings[locs, 2],
y = dwellings[locs, 3],
shape = -1,
lty = 5,
border = 'red')
title(main="A Person's path between Homes")