Evan Kransdorf
2014-10-14 18:12:48 UTC
Hello Everyone,
I was wondering if someone could help me implement a function in R.
I want to pass a vector x to my function, peform some math, then output the
data. However, I want the output for x to be the *name of the vector
I am *using
as input.
For example, data<-c(1,5,10)
z<-x^3
out<-cbind(x,y,z)
return(out)
} #function
Desired output:
data, 1, 1
data, 25, 125
data, 100, 1000
Thanks very much for your help, Evan
[[alternative HTML version deleted]]
I was wondering if someone could help me implement a function in R.
I want to pass a vector x to my function, peform some math, then output the
data. However, I want the output for x to be the *name of the vector
I am *using
as input.
For example, data<-c(1,5,10)
func1<-function(x) {
y<-x^2z<-x^3
out<-cbind(x,y,z)
return(out)
} #function
Desired output:
data, 1, 1
data, 25, 125
data, 100, 1000
Thanks very much for your help, Evan
[[alternative HTML version deleted]]