Thursday, March 05, 2015

R: Appending rows to create new data (appending columns)

If you have a requirement of appending rows from different sources to create a new data row (for eg. Professor and Department he works in, to create an information snippet) here is the simplest trick, use cbind:

> profSharma<-professors(professors$Pid==3,)
> phyDepartment<-department(department$Did==19,)
> cbind(profSharma,phyDepartment)
Happy Programming!

No comments:

Section 80C TMT 2023(PA) – Standard Deduction amounting to a maximum of Rs 8670 under IT rule

With the recently concluded Tax filing season (which if I may draw parallel to the Christmas holiday season enjoyed by one and all), Indians...