how to pass arguments into function within a function in r

后端 未结 1 1510
野的像风
野的像风 2021-02-02 08:29

I am writing function that involve other function from base R with alot of arguments. For example (real function is much longer):

myfunction <- function (data         


        
相关标签:
1条回答
  • 2021-02-02 08:53

    Try three dots instead of four, and add the ellipsis argument to the top level function:

    myfunction <- function (dataframe, Colv = NA, ...) { 
        matrix <- as.matrix (dataframe) 
        out <- heatmap(matrix, Colv = Colv, ...)
        return(out)
    }
    
    0 讨论(0)
提交回复
热议问题