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)

