it works in console, like this: > mult.corr(X,Y) $mult.corr [1] 0.8382398
$p.mult [1] 3.570699e-12 $partial.corr [1] 0.18447499 -0.09837888 0.12007457 $p.partial [1] 0.2094076 0.5058976 0.4162641 and it doesn't work when compiling. Error: chunk 3 (label = ques3) Error in eval(expr, envir, enclos) : could not find function "mult.corr" Execution halted -- View this message in context: http://r.789695.n4.nabble.com/could-not-find-function-when-compiling-PDF-tp4555489p4555518.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.