[R] Starting with R

Paul Bivand paul_bivand at blueyonder.co.uk
Wed Nov 3 00:34:29 CET 2004


in R, the source code for functions can be displayed by typing the function 
name without the brackets. 

Therefore ,

demo

produces the source code

and demo() runs the function - which in this case provides a list of available 
demos.

The source for the graphics demo is a R source file named graphics.R which is 
located in (on my Mandrake linux system, OSX may 
differ) /usr/lib/R/library/graphics/

The source code for functions demonstrated can be similarly displayed, 
although some functions will call C or Fortran modules.

Paul Bivand

On Tuesday 02 Nov 2004 22:35, Anne G wrote:
> I am studying R and within the first 3 lines of
> demo("graphics") I get completely stuck.
>
> could you 1. give me the answer so I can move on 2. tell me
> how I might find the answer.
>
> On my mac OSX, the first command is equivalent to
> get("quartz")()
>
> now get("quartz") would be a regular function format
> but what is get () ()? what kind of beast? does get() return
> a function?
>
> I run demo("graphics") and of course I want to stop it right
> away, without running through the whole demo, how do I STOP
> IT! CANCEL IT? (it gets stuck on hit return to continue
> lines)
>
> Then I want to look at the program that generated
> demo("graphics") and I find a graphic file, but no demo fx.
> where is the demo("graphics") fx physically on my computer?
> how do I find it on a Mac?
>
> Then I want to list the program, but I can't fine a fx which
> list the code of a function.
>
> Sorry, it must seem very basic. But I searched through the
> R intro and through the R lists and I can't find the answer.
>
> Thanks for your help
>
> Anne
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list