Is it possible to add number of points (as text in top right) inside each plot in R.
Thanks
library(tidyverse)
a <- rnorm(100, mean = 0, sd = 1)
b <- rnorm(100, mean = 0, sd = 1)
p <- tibble(a, b) %>%
pivot_longer(cols = everything(), names_to = "category", values_to = "values") %>%
ggplot() +
geom_histogram(aes(x = values),
bins = 20,
color = "black",
fill = "blue",
alpha = 0.7) +
theme_bw() +
facet_grid(category ~ .)
ggsave("sample.png", p)