Skip to content

doubt with function on R software

1 message · Pete Brecknock

#
monicamir88 wrote
Hi

I took the liberty of simplifying things ..... 

# Define Your Function
myfun <- function(a,b,c){
 A = a + 1
 B = b + 2
 C = c + 3
 output <- data.frame(A,B,C)
 return(output)
}

# Test The Function
myfun(0,0,0)

# Input Data
inputData <- data.frame(a=c(1,2,3,4), b=c(10,20,30,40),
c=c(100,200,300,400))

# Ouput Data
outputData  <- do.call(myfun, inputData)

print(outputData)

HTH

Pete



--
View this message in context: http://r.789695.n4.nabble.com/doubt-with-function-on-R-software-tp4658973p4658990.html
Sent from the R help mailing list archive at Nabble.com.