r - Creating data frame from rbind with vectors xmlGetAttr -


i have made rbind print xml-tei attributes vectors. retrieved them xmlgetattr:

listinterp <- (i in 1:length(interp)) print((cbind(rbind(ktu = (xmlgetattr(interp[[i]],"ana")),          verb.category = (xmlgetattr(interpref[[i]],"ana")),          character = (xmlgetattr(interppers[[i]],"ana")),          state =(xmlgetattr(interppers_state[[i]],"ana")),          location = (xmlgetattr(interpplace_loc[[i]],"ana")))))) 

listinterp

sample of result:

          [,1]                                                            ktu           "#ktu1-3_ii_l5b-6a"                                             verb.category "whataction #ktu1-3_ii_l5b-6a_tmtḫṣ #verb.competition #contend" character     "#whatcharacter #character #ant #female"                        state         "#whatrole #active"                                             location      "#whatsphere #outside"                                                    [,1]                                                     ktu           "#ktu1-3_ii_l6b"                                         verb.category "whataction #ktu1-3_ii_l6b_tḫtṣb #confrontation #action" character     "#whatcharacter #character #ant #female"                 state         "#whatrole #active"                                      location      "#whatsphere #outside"                                             [,1]                                                 ktu           "#ktu1-3_ii_l7"                                      verb.category "whataction #ktu1-3_ii_l7_tmḫṣ #destruction #action" character     "#whatcharacter #character #ant #female"             state         "#whatrole #active"                                  location      "#whatsphere #outside"   

then data.frame, have tried:

df <- data.frame(ktu, verb.category, character, state, location) df    #result  ktu                                             verb.category                                  character             state           location  1 #ktu1-3_ii_l15b_16a whataction #ktu1-3_ii_l5b_6a_tmtḫṣ #confrontation    #action #whatcharacter #character #ant #female #whatrole #active #whatsphere #outside 

i don't understand why have first row of data.

a suggestion? in advance, thank you.


Comments