this question has answer here:
in r space have couple of objects, looks like
> objects(pattern="r_") [1] "r_1" "r_10" "r_11" "r_12" "r_13" "r_14" "r_15" "r_16" "r_17" "r_18" "r_19" "r_2" "r_20" [14] "r_21" "r_22" "r_23" "r_24" "r_25" "r_26" "r_27" "r_28" "r_29" "r_3" "r_30" "r_31" "r_32" [27] "r_33" "r_34" "r_35" "r_36" "r_37" "r_38" "r_39" "r_4" "r_40" "r_41" "r_42" "r_43" "r_44" [40] "r_45" "r_46" "r_47" "r_48" "r_49" "r_5" "r_50" "r_51" "r_52" "r_53" "r_54" "r_55" "r_56" [53] "r_57" "r_58" "r_59" "r_6" "r_60" "r_61" "r_62" "r_63" "r_64" "r_65" "r_66" "r_67" "r_68" [66] "r_69" "r_7" "r_70" "r_71" "r_72" "r_73" "r_74" "r_75" "r_76" "r_77" "r_78" "r_79" "r_8" [79] "r_80" "r_9"
these matrixes adn want rbind them, can done by
do.call("rbind", lapply(objects(pattern="r_"),get))->new
my problem sequences of rbind important. in moment rbind in sequence shown above r_1 r_10...what need bind numerically increasing r_1,r_2,r_3....how can that?
you try:
do.call("rbind", lapply(paste0("r_", seq_along(objects(pattern="r_"))), get))
Comments
Post a Comment