Just pass a named vector
f <- function(vars) { nms <- names(vec); ... }
f(c(DAP = var1, ALT = var2))
2009/12/1 Márcio Resende
>
> Hello R-Helpers,
> I am not sure if it is a very simple question but I would like to use two
> (...) in a function, for example,
>
> this is a script where I would
Seems pretty doubtful that a construction like (..., ...) is going to
be accepted by the R interpreter. However, if you construct your
function to handle two objects of equal length, one for the variable
names and the other for their variances, there should be no problem.
If yu want to hand
isn't it simpler just to pass two vectors, say v1 and v2, in which one contains
the object names and the other has the associated variances? (btw, "data" isn't
a good function name)
myData <- function(v1, v2){
Vec <- matrix(v1)
varF <- v2
}
I may have misunderstood your question, but IMHO a
Hello R-Helpers,
I am not sure if it is a very simple question but I would like to use two
(...) in a function, for example,
this is a script where I would like to input the variable names (in one of
the (...)) and the variances associated to those variables which are not
calculated in the script
4 matches
Mail list logo