Dear all:

        I have a list like that,which is a standard str_locate_all() function 
(stringr package) output:
$K
   start end
$GSEGTCSCSSK
   start end
[1,]     6   6
[2,]     8   8
$GFSTTCPAHVDDLTPEQVLDGDVNELMDVVLHHVPEAK
   start end
[1,]     6   6
$LVECIGQELIFLLPNK
   start end
[1,]     4   4
$NFK
   start end
$HR
   start end
$AYASLFR
   start end

I want to transform this list like that:

ID   start.1  start.2 
K   NA  NA
GSEGTCSCSSK 6 8
GFSTTCPAHVDDLTPEQVLDGDVNELMDVVLHHVPEAK 6 NA
LVECIGQELIFLLPNK 4 NA
NFK NA NA
HR NA NA
AYASLFR NA NA

I have already tried to use t() , lapply() but I think it is hard to handle the 
NA value and different rows in every matrix 

Thanks in advance

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to