Skip to content
Prev 377118 / 398502 Next

remove text from nested list

If your matrices are at various depths in the list, try rapply().  E.g.,
a2=c("AAx")), list(B = c("AAb1AAA","AAb2")))
List of 2
 $ A:List of 2
  ..$ a1: chr [1:2, 1:2] "AAA" "AB" "AAB" "AC"
  ..$ a2: chr "AAx"
 $  :List of 1
  ..$ B: chr [1:2] "AAb1AAA" "AAb2"
List of 2
 $ A:List of 2
  ..$ a1: chr [1:2, 1:2] "-" "-B" "-B" "-C"
  ..$ a2: chr "-x"
 $  :List of 1
  ..$ B: chr [1:2] "-b1-" "-b2"
how="replace"))
List of 2
 $ A:List of 2
  ..$ a1: chr [1:2, 1:2] "-" "-B" "-B" "-C"
  ..$ a2: chr "AAx"
 $  :List of 1
  ..$ B: chr [1:2] "AAb1AAA" "AAb2"


Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Oct 25, 2018 at 6:04 PM, Ek Esawi <esawiek at gmail.com> wrote: