File Formats

ProjectTemplate can automatically load a variety of text based file formats, including comma separated value (CSV) files, tab separated value (TSV) files and generic whitespace separated value (WSV) files. In addition, automatic data loading is supported for several binary file formats, including the RData, SPSS, Stata and SAS formats.

Beyond those file formats, several ad hoc file types support the loading of data sets that are accessible over HTTP or contained in SQL databases, such as MySQL and sqlite.

Please note that several of file formats have not been tested yet, including Stata files, Weka files, DBF files, EPIInfo files, MTP files, Octave files, Systat files and SAS files. Because ProjectTemplate is simply wrapping the 'foreign' package, these file formats are expected to work, but we have not confirmed that yet. Your mileage may vary.

Supported File Extensions

Ad Hoc File Types

URL Files

You can access CSV files over HTTP using the .url file extension. Inside of the .url file, you must place DCF that describes your data sources. An example file is shown below:

    url: http://www.johnmyleswhite.com/ProjectTemplate/sample_data.csv

SQL Files

You can access databases stored in a MySQL database using the .sql file extension. Inside of the .sql file, you must place DCF that describes the connection protocol for your database. An example file is shown below:

    type: mysql
    user: sample_user
    password: sample_password
    host: localhost
    dbname: sample_database
    table: sample_table

You can also access databases stored in a SQLite file using the .sql file extension. Inside of the .sql file, you must place DCF that describes the details about the SQLite file. Two example files are shown below:

    type: sqlite
    dbname: /path/to/sample_database
    table: sample_table

    type: sqlite
    dbname: /path/to/sample_database
    query: SELECT * FROM users WHERE user_active == 1

.file Files

You can load data that is not stored in the current project using a .file file. You must specify the path and the extension that the file would have, if it were being loaded by the standard ProjectTemplate auto-loader. An example is shown below that would load an SQLite3 database stored in a separate location:

    path: /path/to/sample_database
    extension: db

Future Support Data Sources

In the future, ProjectTemplate could potentially support the following formats:

If you'd like to help us implement support for these data sources or your favorite data source, please use the mailing list to get in touch with us.