I have a dataframe data which has 6 rows and 6 columns.
data <- data.frame(
Unit = c("A", "A", "B", "B", "C", "C"),
P1 = c(1:6),
P2 = c(1:6),
P3 = c(1:6),
P4 = c(1:6),
P5 = c(1:6),
stringsAsFactors = FALSE)
I need to retain only the first occurrences of unique values in the unit column. How do I achieve this in R? This is what my output should look like.

