Skip to content
Prev 315213 / 398503 Next

extracting character values

Hi,
If you want the NA rows removed, you could, otherwise:
?res<-do.call(data.frame,lapply(netw,function(x) sub("^[[:space:]]*(.*?)[[:space:]]*$","\\1",gsub("\\w+$","",x))))
?res
#???????????? au1?????? au2?????? au3
#1?????????? biau???? weiss?? bhumbra
#2????????? jones? ferguson?????? lam
#3? van den hoofs greidanus??? garbuz
#4?????????? biau?? porcher????? <NA>
#5?????????? biau? ferguson???? chung
#6?????? campagna??? pessis????? biau
#7?????????? biau?? leclerc??? marmor
#8????????? weiss????? biau?? bhumbra
#9????? verdegaal???? bovee pansuriya
#10????????? riad????? biau????? <NA>
?res[complete.cases(res),]#removes the NA rows.
A.K.