How can we subset the dataframe by splitting columns by delimiter and selecting the minimum and maximum value from respective columns.
From data.frame df1, i want to split column from 2 to 4 by delimiter ";" . from column 2 select only the first character vector from column 3 select minimum value and from column 4 select the maximum value
df1 <-
Geneid Chr Start End
CPA1 chr7;chr7;chr7;chr7 60837277;60842119;60844209 60858738;60860094;60861430
GUCY2D chr17;chr17;chr17;chr17 60864066;60865166;60867516 60871561;60873263;60874538
UBC chr12;chr12;chr12;chr12 61053840;61054888;61056916 61090048;61090639;61092555
df2 <-
Geneid Chr Start End
CPA1 chr7 60837277 60861430
GUCY2D chr17 60864066 60874538
UBC cr12 61053840 61092555