gsource                package:Zelig                R Documentation

_R_e_a_d _D_a_t_a _A_s _a _S_p_a_c_e-_D_e_l_i_m_i_t_e_d _T_a_b_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     The 'gsource' function allows you to read a space delimited table
     as a data frame.  Unlike 'scan', you may use 'gsource' in a
     'source'ed file, and unlike 'read.table', you may use 'gsource' to
     include a small (or large) data set in a file that also contains
     other commands.

_U_s_a_g_e:

     gsource(var.names = NULL, variables)

_A_r_g_u_m_e_n_t_s:

var.names: An optional vector of character strings representing the
          column names.  By default, 'var.names = NULL'. 

variables: A single character string representing the data.

_V_a_l_u_e:

     The output from 'gsource' is a data frame, which you may save to
     an object in your workspace.

_A_u_t_h_o_r(_s):

     Olivia Lau <olau@fas.harvard.edu>

_S_e_e _A_l_s_o:

     'read.table', 'scan'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     data <- gsource(variables =  "
                      1 2 3 4 5    
                      6 7 8 9 10   
                      3 4 5 1 3    
                      6 7 8 1 9    ")

     data <- gsource(var.names = "Vote Age Party", variables = "
                                  0    23 Democrat             
                                  0    27 Democrat             
                                  1    45 Republican           
                                  1    65 Democrat             ")
     ## End(Not run)

