I'm learning R and I created a basic ggplot()
with the code below:
ggplot(aes(ACTIVITY_X, ACTIVITY_Y, color = as.factor(cluster), shape = Event)) + geom_point(size=3) + xlab("Axis X") + ylab("Axis Y") + labs(color="Cluster") + labs(shape="Dominant behaviour")
p + theme_classic()
This is an actual picture of it:
I would like to edit the labels below Cluster
, so that they become "Standing"
,"Feeding"
and "Foraging"
.
How can I edit labels from a factor call? I've tried this earlier with no luck:
+ ggplot(aes(ACTIVITY_X, ACTIVITY_Y, color = as.factor(cluster,
+ labels = "Standing",
+ "Feeding", "Foraging"))
+ , shape = Event) +
+ geom_point(size=3) + xlab("Axis X") + ylab("Axis Y") + labs(color="Cluster") + labs(shape="Dominant behaviour")
>
>
>
> p + theme_classic()
Error in as.factor(cluster, labels = "Standing", "Feeding", "Foraging") :
unused arguments (labels = "Standing", "Feeding", "Foraging")
Also, I would like to increase the size of all text in the plot, including axis labels and legends.
Any input is appreciated!