codeChunk-class package:DynDoc R Documentation _C_l_a_s_s "_c_o_d_e_C_h_u_n_k" _D_e_s_c_r_i_p_t_i_o_n: A class to wrap necessary information for a code chunk from a vignette file. _O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s: Objects can be created by calls of the form 'new("codeChunk", ...)'. _S_l_o_t_s: '_c_h_u_n_k_N_a_m_e': Object of class '"character"' The name (if one exists) for the code chunk '_c_h_u_n_k': Object of class '"character"' The code from the code chunk '_o_p_t_i_o_n_s': Object of class '"SweaveOptions"' Any options that were set at the time the code chunk appears in the vignette file _M_e_t_h_o_d_s: _e_v_a_l_C_h_u_n_k 'signature(object = "codeChunk", env="environment")': Will evaluate the code in the code chunk using the environment specified. If no environment is specified, .GlobalEnv is used. _s_h_o_w 'signature(object = "codeChunk")': Displays the information for the code chunk _c_h_u_n_k<- 'signature(object = "codeChunk", value="character")': Edits the 'chunk' slot of the object _c_h_u_n_k 'signature(object = "codeChunk")': Returns the 'chunk' slot of the object _c_h_u_n_k_N_a_m_e 'signature(object = "codeChunk")': Returns the name of the code chunk _g_e_t_O_p_t_i_o_n_s 'signature(object = "codeChunk")': Returns the actual options from the 'options' slot. _S_w_e_a_v_e_O_p_t_i_o_n_s 'signature(object = "codeChunk")': Returns the object stored in the 'options' slot. _A_u_t_h_o_r(_s): Jeff Gentry _S_e_e _A_l_s_o: 'Sweave', 'SweaveOptions', 'chunkList' _E_x_a_m_p_l_e_s: library(tools) testfile <- file.path(.path.package("tools"), "Sweave", "Sweave-test-1.Rnw") if (file.exists(testfile)) { z <- Stangle(testfile,driver=tangleToR) getChunk(z,1) }