Entering edit mode
                    10.4 years ago
        MAPK
        
    
        ★
    
    2.1k
    Hi Guys,
I have this table (mydf) with the column ALT, and I want to split the string in each cell of this column so that there are only one character per cell and cbind them to new column as ALT1, ALT2, ALT3, ..., ALTn based on the number of characters in the cells and get the result table. How can I do this in R? Thank you for your help.
mydf
REF    ALT       GENE
A      GC        MAPK
T      GCA..n    MAP2K
Result:
REF   ALT      ALT1   ALT2   ALTn            GENE
A     GC       G      C                      MAPK
T     GCA..n   G      C      nth character   MAP2K
                    
                
                
Nice solution! Also have a look at the solution posted by me. Might be useful and efficient for huge datasets.