I would like to have only one time 'timepoint 0-1-2' with group 1 and 2 along each other per timepoint. In my graph group 1 and two are completely separated.
I am using the following code
ggplot(data2, aes(x = Timepoint, y = percentage_of_patients_CTCAE_1, fill = CTCAE_1)) + geom_bar(stat = "identity") +facet_grid(~ Group)
this is the data I am using
structure( list( Group = c(1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1), Timepoint = c(0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2), CTCAE_1 = c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2), percentage_of_patients_CTCAE_1 = c( 86.6666666666667, 66.6666666666667, 33.3333333333333, 86.6666666666667, 73.3333333333333, 73.3333333333333, 6.66666666666667, 20, 33.3333333333333, 6.66666666666667, 20, 13.3333333333333, 6.66666666666667, 6.66666666666667, 33.3333333333333 ) ), row.names = c(NA,-15L), class = c("tbl_df", "tbl", "data.frame") )