-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_loader.R
87 lines (66 loc) · 4.87 KB
/
data_loader.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# ***README***
# The following script is used to load the marked spatial point pattern data analyzed in
# the submitted manuscript titled "A Bayesian Hidden Potts Mixture Model for Analyzing
# Lung Cancer Pathology Images."
# Please only run the code of one block each time. The outputs are a data.frame object
# with three columns: x, y, and z, which denote the x, y coordinates, and marks of each
# point. Marks should be labelled as natural numbers 1, 2, 3...
# ***END***
# ========================================================================================
# ========================================================================================
# Load simulated data, where the points are generated from a homogeneous Poisson process
# and Delta shown in Figure 2(a)
# ========================================================================================
# ========================================================================================
data <- read.table("simulated_data_homogeneous_poisson_scenario_1.txt", header = TRUE);
par(pty = "s", mar=c(4.5, 2.5, 1, 1));
plot(data$x, data$y, xlim = c(1, 50), ylim = c(1, 50), col = data$z, pch = data$z,
main = "", xlab = "x", ylab = "y", cex.lab = 1.5, cex.axis = 1.5, cex = 0.5);
# ========================================================================================
# ========================================================================================
# Load simulated data, where the points are generated from a homogeneous Poisson process
# and Delta shown in Figure 2(b)
# ========================================================================================
# ========================================================================================
data <- read.table("simulated_data_homogeneous_poisson_scenario_2.txt", header = TRUE);
par(pty = "s", mar=c(2.5, 2.5, 1, 1));
plot(data$x, data$y, xlim = c(1, 50), ylim = c(1, 50), col = data$z, pch = data$z,
main = "", xlab = "x", ylab = "y", cex.lab = 1.5, cex.axis = 1.5, cex = 0.5);
# ========================================================================================
# ========================================================================================
# Load simulated data, where the points are generated from a log Gaussian Cox process and
# Delta shown in Figure 2(a)
# ========================================================================================
# ========================================================================================
data <- read.table("simulated_data_log_gaussian_cox_scenario_1.txt", header = TRUE);
par(pty = "s", mar=c(2.5, 2.5, 1, 1));
plot(data$x, data$y, xlim = c(1, 50), ylim = c(1, 50), col = data$z, pch = data$z,
main = "", xlab = "x", ylab = "y", cex.lab = 1.5, cex.axis = 1.5, cex = 0.5);
# ========================================================================================
# ========================================================================================
# Load simulated data, where the points are generated from a log Gaussian Cox process and
# Delta shown in Figure 2(b)
# ========================================================================================
# ========================================================================================
data <- read.table("simulated_data_log_gaussian_cox_scenario_2.txt", header = TRUE);
par(pty = "s", mar=c(2.5, 2.5, 1, 1));
plot(data$x, data$y, xlim = c(1, 50), ylim = c(1, 50), col = data$z, pch = data$z,
main = "", xlab = "x", ylab = "y", cex.lab = 1.5, cex.axis = 1.5, cex = 0.5);
# ========================================================================================
# ========================================================================================
# Load NLST data, as shown in Figure 4(a)
# ========================================================================================
# ========================================================================================
data <- read.table("real_data_fig_4a.txt", header = TRUE); # Q = 3, n = 10533
par(pty = "s", mar=c(2.5, 2.5, 1, 1));
plot(data$x, data$y, xlim = c(0, 1), ylim = c(0, 1), col = data$z, pch = data$z,
main = "", xlab = "x", ylab = "y", cex.lab = 1.5, cex.axis = 1.5, cex = 0.5);
# ========================================================================================
# ========================================================================================
# Load NLST data, as shown in Figure 4(b)
# ========================================================================================
# ========================================================================================
data <- read.table("real_data_fig_4b.txt", header = TRUE); # Q = 3, n = 13874
par(pty = "s", mar=c(2.5, 2.5, 1, 1));
plot(data$x, data$y, xlim = c(0, 1), ylim = c(0, 1), col = data$z, pch = data$z,
main = "", xlab = "x", ylab = "y", cex.lab = 1.5, cex.axis = 1.5, cex = 0.5);