1

I have a question regarding R and stringsplit functions. Specifically, I have one column with different attributes that look like this for instance

[30] "8K50WC X3A L8L8 ID PNW PRG PS1 WAF WFR 6XE 3FU 5MU 1XW N5W 8X1"                                                                                            
[31] "8K50SC X3A N9N9 QE PNW PQD WCE WQV 6XE 9Z3 3FU 2PF 7HB N2R 3Y4 8N7"                                                                                        
[32] "8K50SC X3A N9N9 QE PNW PQD WCE WQV 6XE 9Z3 3FU QQ1 2PF 7HB 8Q5 N2R 3PB 5XF 3Y4 8N7"

These are attributes and I have a list that specifies these looking like that:

2 F14 3AP5     Shirazrot Metallic\\Eissilber Metallic
3 F14 4U4U                         Teakbraun Metallic
4 F14 4UY5            Teakbraun Metallic\\Amalfiweiss
5 F14 6Y6Y                     Daytonagrau Perleffekt
6 F14 6YP5 Daytonagrau Perleffekt\\Eissilber Metallic

I would now like to know whether these are presented in the column that I showed above and put instead the description of the codes into the list. the only problem I have is that there are spaces between some (shown in the second table, e.g."F14 4U4U"), however, some may also be a specific attribute without the space (for instance "8K50SC"). So the attribute descriptions vary in terms of the space between.

Basically the result should be "columns that contain the attribute descriptions" (separate for each attribute).

I am a bit puzzled, how could I do this? Help is very much appreciated, I was checking this problem since hours not finding anything that might help.

sgibb
  • 25,396
  • 3
  • 68
  • 74
tobias sch
  • 369
  • 2
  • 15
  • 1
    Welcome on SO! Please read http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. Could you please show what your desired output should be. – sgibb Aug 30 '13 at 06:54

0 Answers0