R - looping function in increments of 1
问题 I have the following function: position_tab <- filter(Tall, Time_point == 2) %>% group_by(Object) %>% summarise(minimum = min(Pixel_pos), maximum = max(Pixel_pos)) position_tab_2 <- mutate(position_tab, midpoint = minimum + ((maximum - minimum)/2)) Which produces: Object minimum maximum midpoint 1 4 22 13 2 39 85 62 etc.. This is filtering for a given timepoint, and creating a new dataframe with the midpoint variable added. Is there a way to loop this in increments of + one, so that the