How to call a result from a function in another one in R -


can please tell me how can call output 2 matrices input function?

x1=function(y,z) {  output1=y*z  output2=y/z }  x2=function(p,q) {  input=x1(y,z)  input1=input$output1    ??? how specify output can call way? output1 , output2 matrices!  input2=input$output2  equation=input1+input2 } 

i tried return() , data.frame both didn't work. tipps?

you can't use c might otherwise expect because you'll lose structure of matrices. instead, use list when want return multiple objects r function.

x1 <- function(y,z) {  list(   output1=y*z,   output2=y/z  ) } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -