[R] Double return statement

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Wed Aug 14 16:34:23 CEST 2013


Dear Katherine,

Combine both outputs in a list and return that.

return(list(first = output.1, second = output.2))

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


-----Oorspronkelijk bericht-----
Van: r-help-bounces op r-project.org [mailto:r-help-bounces op r-project.org] Namens Katherine Gobin
Verzonden: woensdag 14 augustus 2013 16:23
Aan: r-help op r-project.org
Onderwerp: [R] Double return statement

Dear R forum,

I have a function which generates say two outputs, say output_1 and output_2. Output_1 is a single row output whereas Output_2 is a dataframe having multiple records. Is it possible to use two return statements in function. Output_2 uses some records from output_1, hence I need to have these outputs generated from the same function.

Thanking in advance

With warm regards

Katherine
        [[alternative HTML version deleted]]

* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.



More information about the R-help mailing list