Displaying 2 results from an estimated 2 matches for "attempt1".
Did you mean:
attempt
2008 Dec 10
1
First call to constructor fails (R.oo)
...m. I
define a new class/constructor based on the R.oo documentation.
However the first attempt to create an object fails:
=== Code: ===
library(R.oo);
setConstructorS3("MyClass",function(param) {
print(param);
extend(Object(),"MyClass", .param=param);
})
print("Attempt1");
obj = MyClass(1);
=== Output: ===
Loading required package: R.methodsS3
R.methodsS3 v1.0.3 (2008-07-02) successfully loaded. See ?R.methodsS3 for
help.
R.oo v1.4.6 (2008-08-11) successfully loaded. See ?R.oo for help.
[1] "Attempt1"
[1] 1
Error in print(param) : argument "p...
2006 Jun 28
2
hopefully my last question on lapply
...index.
For example, suppose I have a function called
myfunction that takes two vectors as its inputs.
Then, here are my ideas for what could be done.
Attempt 1 : lapply(tradevectors,function(i) myfunction(G[i],B[i])
Attempt 2 : lapply(along=tradevectors),function(i) myfunction(G[[i]],B[[i]]
In attempt1, I am just putting tradevectors and indexing
using the [] which I think won't work. In attemp t2, I am using along=tradevectors and using [[]].
I think # 2 is correct but could someone confirm this
because I have quite large vectors and it's not easy at all
for me to check what's goi...