Answers for "get number of unique values in column r dataframe"

R
0

dataframe number of unique rows

1
# get the unique values (rows) by retaining last row
2
df.drop_duplicates(keep='last')
Posted by: Guest on September-28-2020
0

how to count the number of unique values in a column in r

dummyData = rep(c(1,2, 2, 2), 25)

table(dummyData)
# dummyData
#  1  2 
# 25 75

## or another presentation of the same data
as.data.frame(table(dummyData))
#    dummyData Freq
#  1         1   25
#  2         2   75
Posted by: Guest on April-22-2021

Code answers related to "get number of unique values in column r dataframe"

Browse Popular Code Answers by Language