Hi everyone,

How does one place an object name (in this case a vector name) into another
object (while essentially masking the values of the first object?

For example:

> JOBSAT<-rnorm(40)
>
> CI<-function(x,alpha){
+ result<-cbind(x,mean=mean(x),alpha)
+ print(result)
+ }
> CI(JOBSAT,.05)

I want this to return:

Variable    mean              alpha
JOBSTAT 0.02844131  0.05
Instead, I am getting:

                x       mean alpha
 [1,] -1.07694997 0.02844131  0.05
 [2,] -1.13910850 0.02844131  0.05
 [3,] -0.21922026 0.02844131  0.05
 [4,]  0.38618008 0.02844131  0.05
 [5,] -1.24303799 0.02844131  0.05
 [6,] -0.74903752 0.02844131  0.05
 [7,]  0.96136975 0.02844131  0.05
 [8,] -0.38891237 0.02844131  0.05
 [9,] -0.20195871 0.02844131  0.05
[10,]  0.78104508 0.02844131  0.05
[11,]  0.87468778 0.02844131  0.05
[12,] -1.89131480 0.02844131  0.05


Thank you!

Dan

[13,]  0.74377795 0.02844131  0.05
[14,] -0.60006285 0.02844131  0.05
[15,] -0.76661652 0.02844131  0.05
[16,]  1.06005258 0.02844131  0.05
[17,]  0.02173877 0.02844131  0.05
[18,] -0.36558980 0.02844131  0.05
[19,] -1.92481588 0.02844131  0.05
[20,] -0.50337507 0.02844131  0.05
[21,]  0.82205272 0.02844131  0.05
[22,]  1.59277572 0.02844131  0.05
[23,]  0.59965718 0.02844131  0.05

        [[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