Skip to content

Commit

Permalink
Merge pull request #549 from HopkinsIDD/dev_undo_set_precision
Browse files Browse the repository at this point in the history
remove set precision
  • Loading branch information
eclee25 authored Oct 2, 2023
2 parents 8e822e7 + 642d407 commit 2e538f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions packages/taxdat/R/shapefile_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ clip_shapefiles_to_adm0 <- function(iso_code,
iso_code = iso_code,
admin_levels = c(0),
lps = shapefiles
) %>%
sf::st_set_precision(1e8)
)

sf::st_crs(adm0_geom) <- sf::st_crs(shapefiles) ## same crs needed for st_intersection

# Drop data with no intersections
shapefiles <- shapefiles %>%
sf::st_set_precision(1e8) %>%
dplyr::mutate(adm0_intersect = sf::st_intersects(shapefiles$geom, adm0_geom$geom, sparse = FALSE) %>%
as.vector())

Expand Down
4 changes: 2 additions & 2 deletions packages/taxdat/R/stan_input_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ get_censoring_inds <- function(ind_mapping_resized,
# Get all tfracs for the given observation
tfracs <- ind_mapping_resized$tfrac[ind_mapping_resized$map_obs_loctime_obs == x]
# Define right-censored if any tfrac is smaller than 95% of the time slice
ifelse(any(tfracs <= censoring_thresh), "right-censored", "full")
ifelse(any(tfracs < censoring_thresh), "right-censored", "full")
})
}

Expand Down Expand Up @@ -2059,7 +2059,7 @@ update_stan_data_indexing <- function(stan_data,
stan_data$M <- length(unique(ind_mapping_resized$map_obs_loctime_obs))

# Define censored observations
stan_data$censored <- as.array(ind_mapping_resized$tfrac <= config$censoring_thresh)
stan_data$censored <- as.array(ind_mapping_resized$tfrac < config$censoring_thresh)

for (var in names(ind_mapping_resized)) {
if (var == "map_obs_loctime_obs") {
Expand Down

0 comments on commit 2e538f9

Please sign in to comment.