Skip to content

Commit

Permalink
Update helper_spatial_metrics.R
Browse files Browse the repository at this point in the history
remove starting from 0 in spatial coordinate
  • Loading branch information
ycao6928 authored Nov 28, 2024
1 parent 28d38da commit b24dde5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions R/helper_spatial_metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ individual_celltype_interaction_sp <- function(this_sample) {
cell_points <- spatstat.geom::ppp(
x = this_sample$x_cord,
y = this_sample$y_cord,
check = FALSE,
check = FALSE,,
xrange = c(
min(as.numeric(this_sample$x_cord)),
max(as.numeric(this_sample$x_cord))
),
yrange = c(
min(as.numeric(this_sample$y_cord)),
max(as.numeric(this_sample$y_cord))
),
marks = as.factor(this_sample$celltype)
)

Expand Down Expand Up @@ -360,9 +368,15 @@ individual_L_stat_sp <- function(this_sample) {
cell_points <- spatstat.geom::ppp(
x = this_sample$x_cord ,
y = this_sample$y_cord,
xrange = c(
min(as.numeric(this_sample$x_cord)),
max(as.numeric(this_sample$x_cord))
),
yrange = c(
min(as.numeric(this_sample$y_cord)),
max(as.numeric(this_sample$y_cord))
),
check = FALSE,
yrange = c(0, max(this_sample$y_cord)),
xrange = c(0, max(this_sample$x_cord)),
marks = as.factor(this_sample$celltype)
)

Expand Down

0 comments on commit b24dde5

Please sign in to comment.