Hello I have 2 datasets say Data1 and Data2 both are of different dimesions.
Data1: 120 rows and 6 columns (Varname, Vartype, Labels, Description, ....) The column Varname has 120 rows which has variable names such id, age, gender,.....so on Data2: 12528 rows and 120 columns The column names in this case are V1, V2, ......... V120 (which are default names in R when we say head=F in read.csv) I want to assign the variable names from Data1 to Data2 as the column headings in Data2 i.e V1 should be id, V2 should be age, ...... so on Is it possible to do in R? I tired assigning variable names from Data1 in one object and transposing them and then used rbind but it doesnot work. Can I use colnames? I could not apply it in this case. Can any1 tell me how can i apply it for this case? or should I paste the column names in csv file (from where I have imported the data) and then import in R? Thank you in advance Regards Sunita -- View this message in context: http://www.nabble.com/Assigning-variable-names-from-one-object-to-another-object-tp23695359p23695359.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ [email protected] mailing list 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.

