Imogen R
Imogen R

Reputation: 39

Is there a way to turn off case sensitivity when using unique in R?

I am trying to get rid of non-unique lines in a dataframe in R using the unique function, but do not want to count lines that differ only in capitalization in one of the character vector values as unique. Is there a way to turn off case sensitivity when using the unique function?

Upvotes: 3

Views: 2703

Answers (1)

MeetMrMet
MeetMrMet

Reputation: 1359

You can use unique(tolower(your_var))

Upvotes: 5

Related Questions