I want to produce a facetted scatterplot with ggplot for each scatterplot contains the entire dataset in one colour, with a single ID (of that same dataset) in a different colour on top of the whole scatter. This is the data:
**trajectories**
X Y ID
2 4 1
1 6 1
2 4 1
1 8 2
3 7 2
1 5 2
1 4 3
1 6 3
7 4 3
I use the following code to produce scatterplots for each ID:
ggplot(trajectories, aes(x=X, y=Y)) +
geom_point() +
facet_wrap( ~ ID)
How can I print each of these scatterplots on a scatterplot of the whole dataset?