example                 package:base                 R Documentation

_R_u_n _a_n _E_x_a_m_p_l_e_s _S_e_c_t_i_o_n _f_r_o_m _t_h_e _O_n_l_i_n_e _H_e_l_p

_D_e_s_c_r_i_p_t_i_o_n:

     Run all the R code from the `Examples' part of R's online help
     topic `topic'.

_U_s_a_g_e:

     example(topic, package = .packages(), lib.loc = NULL,
             echo = TRUE, verbose = getOption("verbose"),
             prompt.echo = paste(abbreviate(topic, 6),"> ", sep=""))

_A_r_g_u_m_e_n_t_s:

   topic: name or character:  The online `help' topic the examples of
          which should be run.

 package: a character vector with package names. By default, all
          packages in the search path are used.

 lib.loc: a character vector of directory names of R libraries, or
          `NULL'.  The default value of `NULL' corresponds to all
          libraries currently known.  If the default is used, the
          loaded packages are searched before the libraries.

    echo: logical;  if `TRUE', show the R input when sourcing.

 verbose: logical;  if `TRUE', show even more when running example
          code.

prompt.echo: character; gives the prompt to be used if `echo = TRUE'.

_D_e_t_a_i_l_s:

     If `lib.loc' is not specified, the packages are searched for
     amongst those already loaded, then in the specified libraries. If
     `lib.loc' is specified, they are searched for only in the
     specified libraries, even if they are already loaded from another
     library.

     An attempt is made to load the package before running the
     examples, but this will not replace a package loaded from another
     location.

_V_a_l_u_e:

     (the value of the last evaluated expression).

_N_o_t_e:

     The examples can be many small files. On some file systems it is
     desirable to save space, and the files in the `R-ex' directory of
     an installed package can be zipped up as a zip archive `Rex.zip'.

_A_u_t_h_o_r(_s):

     Martin Maechler and others

_S_e_e _A_l_s_o:

     `demo'

_E_x_a_m_p_l_e_s:

     example(dbinom)
     ## force use of the standard package eda:
     example("smooth", package="eda", lib.loc=.Library)

