Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 836587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:00:28+00:00 2026-05-15T05:00:28+00:00

I have a vector of strings. Check out my vector, it’s awesome : >

  • 0

I have a vector of strings. Check out my vector, it’s awesome:

> awesome
[1] "a" "b" "c" "d" "d" "e" "f" "f"

I’d like to make a new vector that is the same length as awesome but where, if necessary, the strings have been uniqueified. For example, a valid output of my desired function would be

> awesome.uniqueified
[1] "a" "b" "c" "d.1" "d.2" "e" "f.1" "f.2"

Is there an easy, R-thonic and beautiful way to do this? I should say my list in real life (it’s not called awesome) contains 25000ish mircoarray probeset identifiers.

I’m always nervous when I embark on writing little generic functions (which I’m sure I could do) as I’m sure some R guru has come across this problem in the past, nailed it with some incredible algorithm that doesn’t even have to store more than half an element in the vector. I’m just not sure what they might have called it. Probably not uniqueify.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:00:29+00:00Added an answer on May 15, 2026 at 5:00 am

    Try make.unique() where the very first example of the help page is already spot-on:

    make.unique(c("a", "a", "a"))
    [1] "a"   "a.1"   "a.2"
    

    The help page lists Thomas Minka as author. Buy him a beer one day 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a std::vector<uint8_t> that contains strings at specific offsets. Here's a shortened dump:
I have a vector of strings im working trought, and i need to check
I have a vector of strings. Need help figuring out how to convert it
I have some data structures: all_unordered_m is a big vector containing all the strings
I have a vector that I want to insert into a set . This
I have a std::vector and I want to check all the elements in it.
I have a vector x of 1,344 unique strings. I want to generate a
I have a vector x of 1,344 unique strings. I want to generate a
I have an std::vector of std::strings containing data similar to this: [0] = ""
So I basically have a vector args with 1 argument per array that I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.