Name: Anonymous 2012-11-21 11:32
/prog/, I have a problem which is causing me to over-rustle:
I'm programming/scripting with R, and am trying to do this:
myVariable <- return2Vals(1,2)
I want myVariable to hold the first argument, 1, as its "default value" so if i ever do:
print(myVariable) it'll output 1.
However, I also want it to hold the second argument, 2, somewhat secretively but still accessible.
But I'm not sure how to do this;
would accessing it like:
print(myVariable$secondArgument) //outputs 2
be possible? without compromising the first part (print(myVariable)//outputs 1).
Thanks for taking the time to read this.
I'm programming/scripting with R, and am trying to do this:
myVariable <- return2Vals(1,2)
I want myVariable to hold the first argument, 1, as its "default value" so if i ever do:
print(myVariable) it'll output 1.
However, I also want it to hold the second argument, 2, somewhat secretively but still accessible.
But I'm not sure how to do this;
would accessing it like:
print(myVariable$secondArgument) //outputs 2
be possible? without compromising the first part (print(myVariable)//outputs 1).
Thanks for taking the time to read this.