Apply Unique Function to Multiple Columns of Data Frame in R | Using unique & duplicated Functions

Published: 20 April 2021
on channel: Statistics Globe
3,150
32

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  


Watch video Apply Unique Function to Multiple Columns of Data Frame in R | Using unique & duplicated Functions online without registration, duration hours minute second in high quality. This video was added by user Statistics Globe 20 April 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,150 once and liked it 32 people.