Skip to content

Commit

Permalink
Fix issue in calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDAndersen committed Nov 24, 2018
1 parent afbac7a commit 8a05d4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/calc_projections.R
Expand Up @@ -142,7 +142,7 @@ points_sd <- function(src_pts, weights = NULL){
mutate(n_obs = n(),
weight = if_else(n_obs == 1 & weight == 0, 1, weight)) %>%
ungroup() %>% select(-n_obs) %>%
split(src_pts$pos) %>% map(~ split(.x, .x$id)) %>%
split(.$pos) %>% map(~ split(.x, .x$id)) %>%
modify_depth(2, ~ get_sd(.x$points, .x$weight)) %>% modify_depth(2, as.tibble) %>%
modify_depth(1, bind_rows, .id = "id") %>% bind_rows(.id = "pos") %>%
gather("avg_type", "sd_pts", -id, -pos)
Expand All @@ -164,7 +164,7 @@ confidence_interval <- function(src_pts, weights = NULL){
mutate(n_obs = n(),
weight = if_else(n_obs == 1 & weight == 0, 1, weight)) %>%
ungroup() %>% select(-n_obs) %>%
split(src_pts$pos) %>% map(~ split(.x, .x$id)) %>%
split(.$pos) %>% map(~ split(.x, .x$id)) %>%
modify_depth(2, ~ get_quant(.x$points, .x$weight)) %>% modify_depth(3, t) %>%
modify_depth(3, as.tibble) %>% modify_depth(2, bind_rows, .id = "avg_type") %>%
modify_depth(1, bind_rows, .id = "id") %>% bind_rows(.id = "pos") %>%
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.

0 comments on commit 8a05d4a

Please sign in to comment.