[R] prefixing values in a table

laura.hug at utoronto.ca laura.hug at utoronto.ca
Wed Jan 6 00:38:38 CET 2010


Hi,

  I have generated a table of counts, and now need to add a prefix to  
the counts.

#count KO occurrences
KO_occur = table(groupKOIDs) #where groupKOIDs is a vector of characters

e.g.,

if groupKOIDs = c("A", "A", "B", "A")
then
KO_occur would look like this:

A  B
3  1

and I need to add a W to the front of the counts:

A  B
W3  W1

If anyone has ideas for me as to how to approach this, I'd be very grateful!

cheers,
Laura



More information about the R-help mailing list