forked from KentonWhite/ProjectTemplate
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4d6c91
commit 3fd5e3c
Showing
25 changed files
with
366 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build_script.sh | ||
upload.sh | ||
ProjectTemplate.Rcheck | ||
data_examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
Package: ProjectTemplate | ||
Type: Package | ||
Title: Automates the creation of new R statistical analysis projects | ||
Title: Automates the creation of new statistical analysis projects. | ||
Version: 0.1-3 | ||
Date: 2010-08-29 | ||
Date: 2010-10-02 | ||
Author: John Myles White | ||
Maintainer: John Myles White <jmw@johnmyleswhite.com> | ||
Description: The ProjectTemplate package provides a function, create.project(), that automatically builds a directory for a new R project with a clean sub-directory structure and automatic data and library loading tools. The hope is that standardized data loading, automatic importing of best practice packages, integrated unit testing and useful nudges towards keeping a cleanly organized codebase will improve the quality of R coding. | ||
Description: ProjectTemplate provides functions to automatically build a directory structure for a new R project. Using this structure, ProjectTemplate is able to automate data loading, preprocessing, library importing and unit testing. | ||
License: Artistic-2.0 | ||
LazyLoad: yes | ||
Depends: R (>= 2.7), reshape, plyr, stringr, ggplot2, testthat | ||
Depends: R (>= 2.7), testthat, yaml, foreign | ||
Suggests: reshape, plyr, stringr, ggplot2, log4r, RMySQL |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ run.tests <- function() | |
{ | ||
source('lib/run_tests.R') | ||
} | ||
|
||
test.project <- run.tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
show.updates <- function() | ||
{ | ||
default.files <- dir(system.file('defaults', package = 'ProjectTemplate')) | ||
for (default.file in default.files) | ||
{ | ||
canonical.file <- file.path(system.file('defaults', package = 'ProjectTemplate'), default.file) | ||
# Shell escape this. | ||
diff.command <- paste('diff -r', | ||
default.file, | ||
canonical.file, | ||
'2>&1') | ||
diff.output <- system(diff.command, intern = TRUE) | ||
if (length(diff.output) > 0 || nchar(diff.output) != 0) | ||
{ | ||
cat(paste('Your copy of', default.file, 'differs from the current ProjectTemplate version.\n')) | ||
cat(paste('You might want to consider merging changes from\n')) | ||
cat(paste(canonical.file, '\n', sep = '')) | ||
cat('\n') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
(1) Need to deal with empty directories in inst/ not going into git. | ||
(1) Debate integrating log4r and automatically loading it. | ||
|
||
(2) Integrate log4r and automate its loading. | ||
(2) Need to create a show.updates() function that provides a way to merge new defaults into an existing project generated using an earlier version of ProjectTemplate. Decide on proper name. update.project conflicts with | ||
an existing generic method. | ||
|
||
(3) Need to create a update.project() function that provides a way to merge new defaults into an existing project generated using an earlier version of ProjectTemplate. | ||
(3) Debate renaming run.tests() to test.project() permanently. | ||
|
||
(4) Consider renaming run.tests() to test.project() for consistency across names. | ||
(4) Should we automatically run test.project() during load.project()? | ||
|
||
(5) show.updates() won't work on Windows systems. | ||
|
||
(6) show.updates() should offer to replace file after noticing a change. | ||
|
||
(7) All sample .zip files were corrupt. Need proper samples for testing. | ||
|
||
(8) Need sample SPSS and Stata files for testing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# File Formats | ||
ProjectTemplate can automatically load a variety of CSV-like file formats, | ||
including compressed CSV files. In addition, automatic loading is supported | ||
for the binary RData, Stata and SPSS file formats. Finally, ad hoc file | ||
types support the loading of CSV files that are accessible over HTTP and | ||
the automatic loading of data from MySQL tables. | ||
|
||
N.B.: The SPSS and Stata file formats have not been tested yet. Because | ||
ProjectTemplate is simply wrapping the 'foreign' library, they are expected | ||
to work, but I have not confirmed this yet. Your mileage may vary. | ||
|
||
# Supported File Extensions | ||
* `.csv`: CSV files that use a comma separator. | ||
* `.csv.bz2`: CSV files that use a comma separator and are compressed using bzip2. | ||
* `.csv.zip`: CSV files that use a comma separator and are compressed using zip. | ||
* `.csv.gz`: CSV files that use a comma separator and are compressed using gzip. | ||
* `.tsv`: CSV files that use a tab separator. | ||
* `.tsv.bz2`: CSV files that use a tab separator and are compressed using bzip2. | ||
* `.tsv.zip`: CSV files that use a tab separator and are compressed using zip. | ||
* `.tsv.gz`: CSV files that use a tab separator and are compressed using gzip. | ||
* `.wsv`: CSV files that use an arbitrary whitespace separator. | ||
* `.wsv.bz2`: CSV files that use an arbitrary whitespace separator and are compressed using bzip2. | ||
* `.wsv.zip`: CSV files that use an arbitrary whitespace separator and are compressed using zip. | ||
* `.wsv.gz`: CSV files that use an arbitrary whitespace separator and are compressed using gzip. | ||
* `.RData`: .RData binary files produced by `save()`. | ||
* `.rda`: .RData binary files produced by `save()`. | ||
* `.url`: A YAML file that contains an HTTP URL and a separator specification for a remote dataset. | ||
* `.sql`: A YAML file that contains database connection information for a MySQL database. | ||
* `.sav`: Binary file format generated by SPSS. | ||
* `.dta`: Binary file format generated by Stata. | ||
|
||
# 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 YAML that describes your data sources. | ||
An example file is shown below. | ||
|
||
url: "http://www.johnmyleswhite.com/ProjectTemplate/sample_data.csv" | ||
separator: "," | ||
|
||
## SQL Files | ||
You can access database stored in a MySQL database using the `.sql` file | ||
extension. Inside of the `.sql` file, you must place YAML 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 |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.