Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in episode_calculation #111

Closed
fieri opened this issue Dec 24, 2022 · 2 comments
Closed

bug in episode_calculation #111

fieri opened this issue Dec 24, 2022 · 2 comments

Comments

@fieri
Copy link

fieri commented Dec 24, 2022

      # HYPO OR HYPER DURATION LENGTH CALCULATION
      hyp_result = hyp_episode[2:length(hyp_episode)] - hyp_episode[1:length(hyp_episode)-1]
      hyp_end_point = which(hyp_result %in% -1) + 1
      hyp_starting_point = which(hyp_result %in% 1) + 1

      if (is_hypo){
            if(gl_by_id_ip[length(gl_by_id_ip)] <= params[[2]]){
              hyp_end_point = c(hyp_end_point, length(hyp_result))    # wrong
              hyp_end_point= sort(hyp_end_point)
            }
            if(gl_by_id_ip[1] <= params[[2]] ) {
              hyp_starting_point = c(hyp_starting_point, 1)
              hyp_starting_point= sort(hyp_starting_point)
            }
      }else{
            if(gl_by_id_ip[length(gl_by_id_ip)] >= params[[3]]){
              hyp_end_point = c(hyp_end_point, length(hyp_result))
              hyp_end_point= sort(hyp_end_point)
            }
            if(gl_by_id_ip[1] >= params[[3]] ) {
              hyp_starting_point = c(hyp_starting_point, 1)
              hyp_starting_point= sort(hyp_starting_point)
            }
      }

      hyp_dur_length = hyp_end_point - hyp_starting_point
@fieri fieri closed this as completed Dec 24, 2022
@fieri fieri reopened this Dec 24, 2022
@fieri
Copy link
Author

fieri commented Dec 24, 2022

      if (is_hypo){
        if(gl_by_id_ip[1] <= params[[2]] ) {
          hyp_starting_point = c(hyp_starting_point, 1)
          hyp_starting_point= sort(hyp_starting_point)
        }
        if(length(hyp_starting_point) > length(hyp_end_point)){
          hyp_end_point = c(hyp_end_point, length(gl_by_id_ip))
        }

      }else{
        if(gl_by_id_ip[1] >= params[[3]] ) {
          hyp_starting_point = c(hyp_starting_point, 1)
          hyp_starting_point= sort(hyp_starting_point)
        }
        if(length(hyp_starting_point) > length(hyp_end_point)){
          hyp_end_point = c(hyp_end_point, length(gl_by_id_ip))
        }
      }

@irinagain
Copy link
Owner

We finally fixed this on github, I am sorry it took us a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants