0
votes

Say I have some tibble with coordinates called 'coordinates'. I plot these coordinates and I want to have it in points, so for that I use geom_points:

coordinates <- tibble(x = x_coords, y = y_coords)
ggplot(coordinates, aes(x = x, y = y)) + geom_point()

How would I change the geom_point() so that it for example always removes the point from the first coordinate in the plot when for example putting geom_point() + geom_line()

1

1 Answers

1
votes

filter those points from your dataset:

coordinates <- tibble(x = x_coords, y = y_coords)

ggplot(coordinates, aes(x = x, y = y)) +
  geom_point(data = coordinates %>% filter(row_number() > 1)) +
  geom_line()