In R, how can I loop over repeated XML nodes, and save text values in a list?

后端 未结 3 1840
独厮守ぢ
独厮守ぢ 2021-02-10 23:43

I\'m working with XML files from clinicaltrials.gov, which have a structure like this:


  ...
  
  ...
  

        
3条回答
  •  无人共我
    2021-02-11 00:17

    Here is an example

     ns <- getNodeSet(xml, '//clinical_results/outcome_list/outcome/analysis_list/analysis/method')
     element_cnt <-length(ns))
     strings<-paste(sapply(ns, function(x) { xmlValue(x) }),collapse="|"))
    

提交回复
热议问题