[R] Execution of a function

R. Michael Weylandt michael.weylandt at gmail.com
Tue Aug 7 22:56:40 CEST 2012


On Tue, Aug 7, 2012 at 11:26 AM, hafida <hafida-06 at hotmail.fr> wrote:
> Hi
>
>>i have  aproblem withe execution of my function
>
>>first, i wrote my function in the script of R
>>nom_fonction <- function(arg1[=expr1], arg2[=expr2], ...){
> bloc d'instructions
> }
>
>> when i want to have the result i mean the laste instruction in the bloc of
>> instruction ,  i try to
>>wrote the name of function
>
>>source(aj.fun)
> Error in readLines(file, warn = FALSE) : 'con' is not a connection

source() takes a file name, not a function name.

Cheers,
Michael

>
>>return(aj.fun)
> Error: no function to return from, jumping to top level

Don't use return() outside of functions.


>
> thanks for helping
> hafida, univ of algeria
>
>
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Execution-of-a-function-tp4639424.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list