Re: [R] To give column names of a data-frame

2010-06-10 Thread Joris Meys
First of all, read the help file ?data.frame. What you do is adding a variable row.names, column.names and title to your dataframe. What you want to do is set the rownames and colnames. > results <- data.frame(matrix(c(1,2,3,4),nrow=2,ncol=2)) > rownames(results) <- c("a","b") > colnames(results

[R] To give column names of a data-frame

2010-06-10 Thread suman dhara
Sir, I want to export the results of R in a data frame. So I want to give rownames,columnnames & title to the data-frame.I have applied the following: data.frame(matrix(c(...),nrow=,ncol=),row.names=c("a","b"),col.names=c("c","d"),title="aaa") But, it does not work. Can you help me? Regards, S