How to apply the unique function to multiple columns in the R programming language. More details: https://statisticsglobe.com/apply-uni...
R code of this video:
data <- data.frame(x1 = c(1, 1, 1, 2, 2, 2), # Creating example data
x2 = c("a", "a", "b", "b", "b", "c"),
x3 = LETTERS[1:6])
data_unique <- unique(data[ , c("x1", "x2")]) # Apply unique
data_duplicated <- data[!duplicated(data[ , c("x1", "x2")]), ] # Apply duplicated
Follow me on Social Media:
Facebook: / statisticsglobecom
LinkedIn: / statisticsglobe
Patreon: / statisticsglobe
Pinterest: https://www.pinterest.de/JoachimSchork
Reddit: / joachimschork
Twitter: / joachimschork