Bioequivalence and Bioavailability Forum

Main page Policy/Terms of Use Abbreviations Latest Posts

 Log-in |  Register |  Search

Back to the forum  Query: 2017-03-29 01:33 CEST (UTC+2h)
 

Smart recoding of vector values [R for BE/BA]

posted by ElMaestro - Denmark, 2016-09-21 12:59  - Posting: # 16657
Views: 1,650

Hi all, especially the R experts out there,

I have a vector like
a=c(1,1,2,2,3,5,5,6,6,7,8,8,9,9)
and I would like to rename/reorder/resomething this vector so that
a=c(1,1,2,2,3,4,4,5,5,6,7,7,8,8)

They are actually factor levels.

So far I took a look at reorder, rank, and sort and googled around but I am not really getting anywhere. I have written a clumsy function that does the trick, but I am sure this can be achieved with a one-liner somehow.

Anyone able to tell how?

Thanks a lot in advance and have a great day.:-)

I could be wrong, but…


Best regards,
ElMaestro


Here's the good news, folks: If you leave operational excellence, (c)LEAN, six sigma and management consultancy firms out of your development programmes, then you may have a chance to be first to market and to beat your competitors.

Complete thread:

Back to the forum Activity
 Mix view
Bioequivalence and Bioavailability Forum | Admin contact
16,703 Posts in 3,586 Threads, 1,029 registered users;
12 users online (0 registered, 12 guests).

Most scientists today are devoid of ideas, full of fear, intent on
producing some paltry result so that they can add to the flood
of inane papers that now constitutes “scientific progress”
in many areas.    Paul Feyerabend

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
XHTML/CSS RSS Feed