isoverse / isoorbi

https://www.isoverse.org/isoorbi
Other
3 stars 1 forks source link

Add a segmenting function #5

Closed 123caj closed 1 year ago

123caj commented 1 year ago

orbi_segment(n = INTEGER; by = c("scan", "time")) => add column "segment"

adjust other functions to use "segments" as a grouping variable

123caj commented 1 year ago

Use cut() function? Or ggplot::cut_number()?

x <- [1:10](https://www.youtube.com/watch?v=X02wApMJOek&t=70s)                                      # Create example vector
x                                              # Print example vector

x_cut <- cut(x, breaks = c(0, 4, 6, 7, 10))    # Apply cut()
x_cut                                          # Print output
sebkopf commented 1 year ago

I implemented it with modulus, which is faster than cut

sebkopf commented 1 year ago

implementation question: currently the segmentation function only segments the data flagged as being part of a data group (i.e. not the changeover, startup or otherwise unused). Is there ever a scenario where you would want to also segment these other parts of the data?

sebkopf commented 1 year ago

this is ready for testing in the dev-v1.1 branch @123caj @brettdavidheiser @SabrielxD with a few examples in the dual_inlet.Rmd vignette:

From vignette e.g. with orbi_segment_blocks(into_segments = 3):

image

and with orbi_segment_blocks(by_scans = 5) :

image

123caj commented 1 year ago

implementation question: currently the segmentation function only segments the data flagged as being part of a data group (i.e. not the changeover, startup or otherwise unused). Is there ever a scenario where you would want to also segment these other parts of the data?

From the top of my head, I can't think of such a need. @brettdavidheiser Do you perhaps want more control to evaluate changeover time? E.g. segmenting function could be used to assess the quality of the applied change over time??

@sebkopf this looks awesome! Big step forward :)