I built my own "outer lapply " as attached code. Is there any R
build-in function can do the same jobs ?
Thanks
oapply<-function(X,Y,FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE,
USE.NAMES = TRUE){
x=rep(X,each=length(X))
y=rep(Y,times=length(Y))
mapply(FUN,x,y, MoreArgs =
How can i select a set of element in a list ?
x<-list(1,2,3,4,5)
How can I create a new list which only have the last 4 elements of x.
I can do it with a loop, but I want to avoid that. Thanks!
example :
y<-vector("list",4)
for ( i in 1:length(y) )
y[[i]] <- x[[ i + length(x) - length(y) ]]
Hi all,
Is there any tutorial for learning C/R interface ? Thanks
Regards,
Julian
[[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://w
Hi all,
Is there any way for me to to string in the argument of qplot or ggplot? for
example
qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth'))
instead of
qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth'))
Thanks!!
Regards,
TszKin Julian
[[alternative HTML ve
Hi all,
Within a foreach loop with doSNOW, we cant call functions which come from
the non-default package. We need to load(require/library) the package once
more within the foreach loop. Anyone knows why would happen like this? Is it
caused by the snow package and something happened when "snow" pa
Hi all,
I can create a text-progress bar in a foreach loop by the following code :
n=10
foreach( i = 1:n ,.combine=c) %do%{
setTxtProgressBar(pb, i)
Sys.sleep(0.1)
}
However, once i use the parallelized foreach, the text-progress bar
disappear. Any solution to this problem? How
Hi all,
Suppose I have a matrix of logical value:
x<-matrix(c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE),nrow=3)
I would like to change the value of FALSE to 0 and TRUE to 1. An
obvious way to do it is :
y<-as.numeric(x)
However this method doesn't keep the dim of x. I also need to copy
Hi
Is there any package in R that allow me to do IV probit, just like the
ivprobit command in stata.
or do i have to carry out the newey's two-step estimator myself?
Regards,
Julian
[[alternative HTML version deleted]]
__
R-help@r-project.or
8 matches
Mail list logo