gsource {Zelig} | R Documentation

## Read Data As a Space-Delimited Table

### Description

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.

### Usage

    gsource(var.names = NULL, variables)

### Arguments

`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.

### Value

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

### Author(s)

Olivia Lau <olau@fas.harvard.edu>

### See Also

`read.table`, `scan`

### Examples

    ## 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)

[Package Zelig version 3.4-3 Index]