misantamaria commited on
Commit
bd51217
1 Parent(s): c14325b

hot fix projection points

Browse files

Reject previous PR.
Hot fix:
- Select 1-2 projections points error
- Reduced window indices are already a date

Files changed (1) hide show
  1. r_shiny_app/server.R +10 -8
r_shiny_app/server.R CHANGED
@@ -745,16 +745,18 @@ shinyServer(function(input, output, session) {
745
  # Create a reduced window list
746
  reduced_window_list <- vector(mode = "list", length = length(idx_window_limits)-1)
747
  # Populate the first element of the list with the idx of the first window.
748
- reduced_window_list[[1]] <- c(unlist_window_indices[idx_window_limits[1]],
749
- unlist_window_indices[idx_window_limits[1+1]])
 
 
750
  # Populate the rest of the list
751
- for (i in 2:(length(idx_window_limits)-1)){
 
752
  reduced_window_list[[i]]<- c(
753
- #unlist_window_indices[idx_window_limits[i]+1],
754
- #unlist_window_indices[idx_window_limits[i+1]]
755
- as.Date(isolate(tsdf())$timeindex[unlist_window_indices[idx_window_limits[i]+1]]),
756
- as.Date(isolate(tsdf())$timeindex[unlist_window_indices[idx_window_limits[i+1]]])
757
- )
758
  }
759
  reduced_window_list
760
  })
 
745
  # Create a reduced window list
746
  reduced_window_list <- vector(mode = "list", length = length(idx_window_limits)-1)
747
  # Populate the first element of the list with the idx of the first window.
748
+ reduced_window_list[[1]] = c(
749
+ isolate(tsdf())$timeindex[unlist_window_indices[idx_window_limits[1]+1]],
750
+ isolate(tsdf())$timeindex[unlist_window_indices[idx_window_limits[2]]]
751
+ )
752
  # Populate the rest of the list
753
+ if (length(idx_window_limits) > 2) {
754
+ for (i in 2:(length(idx_window_limits)-1)){
755
  reduced_window_list[[i]]<- c(
756
+ isolate(tsdf())$timeindex[unlist_window_indices[idx_window_limits[i]+1]],
757
+ isolate(tsdf())$timeindex[unlist_window_indices[idx_window_limits[i+1]]]
758
+ )
759
+ }
 
760
  }
761
  reduced_window_list
762
  })