I have a dataframe subset but whenever I attempt to use groupby it gives errors for rows in which the column I’m trying to group by has parentheses. I’m trying to drop these rows and I know I could do it by indexing but the data frame is pretty big, I feel as if there’s an easier way.
`all_bandit <- data.frame(
id = 1:5,
accepted_name = c("Acanthorhynchia (Echinirhynchia)", "Balanus glandula", "Chthamalus (Chthamalus)", "Mytilus edulis", "Semibalanus balanoides"),
early_interval = c(190, 85, 245, 0.126, 23), # Numeric values for early interval
late_interval = c(150, 66, 235, 0.0117, 5.3) # Numeric values for late interval
)
fadlad <- all_bandit %>%
group_by(accepted_name) %>%
summarise(
fad = max(interval.ma),
lad = min(interval.ma)
`
I tried filtering them out individually but that made my dataframe null somehow plus I know this can be easier.
all_bandit_filtered <- all_bandit[all_bandit$accepted_name != "Acanthorhynchia (Echinirhynchia)", ]