Skip to content

Commit

Permalink
filter out rss = 0 for sd(iss) calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-hulson committed Aug 7, 2024
1 parent 8f720ae commit 47c631f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ iss_stats <- function(iss_data, rss_data, iter, tot, reg){
if('region' %in% colnames(iss_data)){
iss_data %>%
tidytable::left_join(rss_data %>%
tidytable::filter(rss != 0) %>%
tidytable::summarise(v = var(1 / rss),
n = length(rss),
m = 1 / length(rss) * sum(1 / rss),
Expand All @@ -468,6 +469,7 @@ iss_stats <- function(iss_data, rss_data, iter, tot, reg){
} else{ # without subregion case
iss_data %>%
tidytable::left_join(rss_data %>%
tidytable::filter(rss != 0) %>%
tidytable::summarise(v = var(1 / rss),
n = length(rss),
m = 1 / length(rss) * sum(1 / rss),
Expand All @@ -482,6 +484,7 @@ iss_stats <- function(iss_data, rss_data, iter, tot, reg){
if('length' %in% colnames(iss_data)){
iss_data %>%
tidytable::left_join(rss_data %>%
tidytable::filter(rss != 0) %>%
tidytable::summarise(v = var(1 / rss),
n = length(rss),
m = 1 / length(rss) * sum(1 / rss),
Expand Down

0 comments on commit 47c631f

Please sign in to comment.