1

I have created one function Dummyfunc which calculates fold-change for different samples. I am using gsva function inside this Dummyfunc function. I want to access all the arguments of the gsva function from my Dummyfunc so that I can change the values of the arguments as per the need. So far I have tried doing like this :-

Dummyfunc <- function(method="gsva",verbose=TRUE,kernel=){
gsva(method=method,kernel=kernel,verbose=verbose)
}

But can it be done in automated fashion so that all arguments of gsva function can be accessed from Dummyfunc

2 Answers 2

2

if i understand your problem correctly, you should just pass them all with ... you could potentially write them all out, but that might take a while.

# define the internal function
f.two <- 
    function( y , z ){
        print( y )
        print( z )
    }

# define the external function,
# notice it passes the un-defined contents of ... on to the internal function
f.one <-
    function( x , ... ){
        print( x )

        f.two( ... )

    }

# everything gets executed properly
f.one( x = 1 , y = 2 , z = 3 )      
Sign up to request clarification or add additional context in comments.

Comments

1

I'm not really sure what you are after, but would about using .... For example:

Dummyfunc = function(...)
     gsva(...)

or

Dummyfunc = function(method="gsva", verbose=TRUE, ...)
     gsva(method=method, verbose=verbose, ...)

We use ... to pass any additional arguments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.