[R] Demo code

Jim Lemon jim at bitwrit.com.au
Fri Oct 26 11:54:05 CEST 2012


On 10/26/2012 09:17 AM, Rlotus wrote:
> I have code in R. I need also demo code of my output and demo code of code. I
> dont know what is demo. An d how to create it...can you tell how to do that
> plz. thank you.
>
>
Hi Rlotus,
The "demo" code for a package is usually selected from the examples of 
the functions in the package. Compile an R source code file with the 
examples that you want to include and save it in the "demo" directory 
under the package directory with the same name as the package. Using the 
plotrix package as an example:

plotrix/data
	(datasets for the examples)
plotrix/demo
	00index (a one liner containing:
		plotrix	a demo of many plotrix functions)
	plotrix.R (the demo code)
plotrix/inst
	(citation file)
plotrix/man
	(help pages in Rd markup language)
plotrix/R
	(functions in R code)

Having a demo code file is usually only useful if you are creating a 
package.

Jim




More information about the R-help mailing list