Sorry, the last post had a small mistake. I got name and val switched. Here they are in the correct order.
ID_names1 <- paste0("id0000",1:9) ID_names2 <- paste0("id000",10:99) ID5 <-as.data.frame(ID_names1) ID5$name<-colnames(ID5) colnames(ID5)<-c("val","name") ID6 <-as.data.frame(ID_names2) ID6$name<-colnames(ID6) colnames(ID6)<-c("val","name") IDall<-rbind(ID5,ID6) Tim -----Original Message----- From: anteneh asmare <hanatez...@gmail.com> Sent: Monday, June 13, 2022 4:49 PM To: Ebert,Timothy Aaron <teb...@ufl.edu> Cc: r-help@r-project.org Subject: Re: [R] Combining Differnt columns in one single column [External Email] Dear Tim it works, But i want to treat them as a column name. Is it possible to treat as a column name ? Best, Hana On 6/13/22, Ebert,Timothy Aaron <teb...@ufl.edu> wrote: > ID5 <- as.data.frame(ID_names1) > colnames(ID5)<-"val" #rename the columns so they have the same name. > ID6 <- as.data.frame(ID_names2) > colnames(ID6)<-"val" > rbind(ID5, ID6) > > This works for the first two, just keep doing the same thing for the > others. > Tim > > -----Original Message----- > From: R-help <r-help-boun...@r-project.org> On Behalf Of anteneh > asmare > Sent: Monday, June 13, 2022 3:48 PM > To: r-help@r-project.org > Subject: [R] Combining Differnt columns in one single column > > [External Email] > > Dear All, I have the following column name in different data frame and > different size > ID_names1 <- paste0("id0000",1:9) > ID_names2 <- paste0("id000",10:99) > ID_names3 <- paste0("id00",100:999) > ID_names4 <- paste0("id0",1000:9999) > ID_names5 <- paste0("id",10000:50000) > Dose it possible to combine in to a single column in r? > Best, > Hana > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mail > man_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAs > Rzsn7AkP-g&m=cjCY0UmRewiKkMVVxNu2riO8k4tZHD7s7R3R6SC-bwEM5u77LyExCSIzw > I-q7Xu_&s=xrZArAFWnJf7ja13EEgxwBj-pMBEXBYSQgc6BhtNPAA&e= > PLEASE do read the posting guide > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.or > g_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeA > sRzsn7AkP-g&m=cjCY0UmRewiKkMVVxNu2riO8k4tZHD7s7R3R6SC-bwEM5u77LyExCSIz > wI-q7Xu_&s=oUlYLeH_EF5rwea10resAheSjjvJ6nhUl8wT84OVXZM&e= > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.