search for: idc318

Displaying 5 results from an estimated 5 matches for "idc318".

Did you mean: id18
2009 Aug 05
4
A question regarding R scoping
I have a question related to scoping. Suppose we have 2 functions: f1 = function(i){i = 1} f2 = function(n){ i = length(n) f1(i) } In other words, I would like i=1 regardless of n. Is this possible without having f1 in the body of f2? Thanks in advance!
2009 Jun 24
3
List subsetting
Hello, I have a question about list indexing. Lets say we have a list of 3 lists, each containing 3 different type elements: > a=replicate(3, list(list(c(1,1,1), diag(3), c(2,2,2)))) > a [[1]] [[1]][[1]] [1] 1 1 1 [[1]][[2]] [,1] [,2] [,3] [1,] 1 0 0 [2,] 0 1 0 [3,] 0 0 1 [[1]][[3]] [1] 2 2 2 [[2]] [[2]][[1]] [1] 1 1 1 [[2]][[2]] [,1] [,2] [,3]
2009 Jun 26
1
pass a vector to C++
Hi, Does anyone know how to pass a vector of strings, for example "c("1", "2", "3") to a C++ function? Should the input argument to the C++ function be vector<string>*? Thanks a lot! Ivo
2011 Apr 13
3
predict()
Hi, I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=function(dat,fm) { predict(coxph(fm,data=dat),type='lp',newdata=dat) } # Under R 2.11.1 and
2011 Apr 13
3
predict()
Hi, I am experimenting with the function predict() in two versions of R and the R extension package "survival". library(survival) set.seed(123) testdat=data.frame(otime=rexp(10),event=rep(0:1,each=5),x=rnorm(10)) testfm=as.formula('Surv(otime,event)~x') testfun=function(dat,fm) { predict(coxph(fm,data=dat),type='lp',newdata=dat) } # Under R 2.11.1 and