Hello,

I have an r function that creates the following dataframe tresults2.
Notice that column 1 does not have a column heading.

Tresults2:
                 [,1]
estparam     18.00000
nullval      20.00000
. . .
ciWidth       2.04622
HalfInterval  1.02311

pertinent code:
results<-cbind( estparam, nullval, t, pv_left, pv_right, pv_two_t, 
estse, df,  cc, tbox, llim, ulim, ciWidth, HalfInterval)
tresults<-round((results),5)
tresults2<-data.frame(t(tresults))
names(tresults2)<-c("Statistic ", "Value")
tresults2

===========================================================================================
After transposing my dataframe tresults2 consists of 2 columns.  
Col1=alphanumeric data (this really is a variable name) and
col2=numeric data (this is value of varaiable).

how do I name columns when columns are different (alphanumeric and numeric)
to avoid the following error:

Error in names(tresults2) <- c("Statistic ", "Value") :
  'names' attribute [2] must be the same length as the vector [1]

Am I to use c( , ) or list( , ) with a dataframe?

Thank you for your help.
Sincerely,
Mary A. Marion





        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to