Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 505
Imogen R Avatar asked Oct 21 '25 07:10

Imogen R


1 Answers

You can use unique(tolower(your_var))

like image 181
MeetMrMet Avatar answered Oct 22 '25 23:10

MeetMrMet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!