Skip to content

Commit

Permalink
Merge pull request irinagain#158 from walterwilliamson/master
Browse files Browse the repository at this point in the history
Update mage_ma_single.R
  • Loading branch information
irinagain authored Jul 30, 2024
2 parents c7cd852 + 9f8ca01 commit 95bd83a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/mage_ma_single.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ mage_ma_single <- function(data,
} else if (nmeasurements < long_ma){
# The total number of measurements is smaller than the long moving average window
return(data.frame(start=utils::head(.data$time, 1), end=utils::tail(.data$time, 1), mage=NA, plus_or_minus=NA, first_excursion=NA))
} else if (sd(.data$gl, na.rm = TRUE) < 1){
# There is no glucose variation in the block
return(data.frame(start=utils::head(.data$time, 1), end=utils::tail(.data$time, 1), mage=NA, plus_or_minus=NA, first_excursion=NA))
}

# 2c. Calculate the moving average values
Expand Down

0 comments on commit 95bd83a

Please sign in to comment.