You can try this:
library(dplyr)
ranges %>%
arrange(start) %>%
group_by(g = cumsum(cummax(lag(stop, default = first(stop))) < start)) %>%
summarise(start = first(start), stop = max(stop))
# A tibble: 2 × 3
# g start stop
# <int> <dbl> <dbl>
#1 0 65.72000 87.75625
#2 1 89.61625 104.94062
Related Contents:
- Subset data frame based on number of rows per group
- Select rows from a data frame based on values in a vector
- Why is `[` better than `subset`?
- Compare two data.frames to find the rows in data.frame 1 that are not present in data.frame 2
- How to subset matrix to one column, maintain matrix data type, maintain row/column names?
- Opposite of %in%: exclude rows with values specified in a vector
- Selecting data frame rows based on partial string match in a column
- Subset / filter rows in a data frame based on a condition in a column
- Repeat rows of a data.frame [duplicate]
- Select groups with more than one distinct value
- How to drop columns by name in a data frame
- How to replace NA with mean by group / subset?
- Subset dataframe by multiple logical conditions of rows to remove
- Filtering a data frame on a vector [duplicate]
- How do I extract a single column from a data.frame as a data.frame?
- Subset rows in a data frame based on a vector of values
- Remove group from data.frame if at least one group member meets condition
- Subset a dataframe between 2 dates
- How to delete rows from a dataframe that contain n*NA
- Delete rows containing specific strings in R
- Subsetting R data frame results in mysterious NA rows
- Subset of rows containing NA (missing) values in a chosen column of a data frame
- subset a column in data frame based on another data frame/list
- Subset data frame based on multiple conditions [duplicate]
- Subset data to contain only columns whose names match a condition
- For each row in an R dataframe
- Subset and ggplot2
- Filter data frame rows based on values in vector
- Reading multiple files and calculating mean based on user input
- Subsetting data.table using variables with same name as column
- sum cells of certain columns for each row
- remove IDs that occur x times R
- How to remove rows with any zero value
- Using multiple criteria in subset function and logical operators
- How to append rows to an R data frame
- Using grep to help subset a data frame
- Update subset of data.table based on join
- dplyr – filter by group size
- How to delete groups containing less than 3 rows of data in R? [duplicate]
- R: How to filter/subset a sequence of dates
- R gotcha: logical-and operator for combining conditions is & not &&
- Counting number of instances of a condition per row R [duplicate]
- R keep rows with at least one column greater than value
- Return data subset time frames within another timeframes?
- Split/subset a data frame by factors in one column [duplicate]
- Subset based on variable column name
- Subsetting a dataframe for a specified month and year
- Looping through t.tests for data frame subsets in r
- Selecting columns in R data frame based on those *not* in a vector
- Subsetting data.table set by date range in R