If having the definition of the function appear when you enter the name of the 
function elicits a "hate" response, then perhaps you should not be using R. 
That characteristic of R is fundamental and unlikely to change: in R everything 
is an object, and the result of evaluating an expression is displayed at the 
command line. Other languages have different unifying principles, and may be 
appropriate for different tasks.

Anything that can be done in R could be done in, say, C, but by the time you 
did so you might find yourself learning very similar lessons to the ones R 
assumes you know.

"Duke" <duke.li...@gmx.com> wrote:

>  On 9/16/10 5:00 PM, Rolf Turner wrote:
>> On 17/09/2010, at 8:51 AM, Duke wrote:
>>
>>>   Hi Duncan,
>>>
>>> On 9/16/10 3:47 PM, Duncan Murdoch wrote:
>>>> On 16/09/2010 3:40 PM, Duke wrote:
>>>>>    Hi all,
>>>>>
>>>>> I am writing a function (fun.R), but I dont know how to code the
>>>>> function so that the Help Text will be shown up when one types ?fun (of
>>>>> course, after he loads it up). Anyone has any advice for me how to do
>>>>> that?
>>>>>
>>>>>
>>>> The help text is separate from the function (unless you use the
>>>> roxygen package or similar).  You need to write a package so that R
>>>> will find the help; instructions are in the Writing R Extensions manual.
>>> I was expecting something simpler than writing a package, and that I can
>>> integrate it into fun.R, but thanks anyway.
>> (a) Writing a package is not all that hard.
>
>You can say so if you are fluent in R. I just started and have written 
>only 20-30 lines of codes so far. Also, writing a package is still more 
>complicated than writing a simple function (single file). Why R is so 
>different from other languages (python, matlab or more basics like C/C++ 
>etc...)? In fact I still feel very uncomfortable with R, for example, I 
>hate when I type a function name, it shows the whole function.
>
>Honestly I feel a world of programming is a mess, and it is tough when 
>one wants to jump from one language to another.
>
>> (b) It focuses the mind wondrously.
>
>I did try to write a simple package (followed a tutorial), but did not 
>find what you said :). Maybe I need more practice.
>
>> (c) Using R CMD check on the package is very useful for picking the
>> lint off the code.
>>
>
>It would be great if you share your experience a little more about this.
>
>Thanks,
>
>D.
>
>>      cheers,
>>
>>              Rolf Turner
>>
>> ######################################################################
>> Attention:
>> This e-mail message is privileged and confidential. If you are not the
>> intended recipient please delete the message and notify the sender.
>> Any views or opinions presented are solely those of the author.
>>
>> This e-mail has been scanned and cleared by MailMarshal
>> www.marshalsoftware.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.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnew...@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

______________________________________________
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.

Reply via email to