Project: An R package for managing document versions and templates.

Description Usage Arguments Details Examples

View source: R/Project.R

Description

The idea of build automation is not new. GNU Make and Java Ant are well established and robust build automation systems but require the use and installation of additional software. The makeR package provides a sim- plified framework written entirely in R to manage Sweave projects where multiple versions are created based upon a single source repository. For example, a monthly report where each version is identical, with perhaps the exception of easily extracted properties (e.g. date ranges for data extraction, title, etc.).

Usage

1
2
3
4
  Project(projectDir = getwd(), name = NULL,
    sourceDir = "source", buildDir = "build",
    releaseDir = "release", sourceFile = NULL,
    properties = list())

Arguments

projectDir

the root directory of the project.

name

the name of the project. Only used for new projects.

sourceDir

the directory containing the source files. Only used for new projects.

buildDir

the directory where built versions will be located. Only used for new projects.

releaseDir

the directory where released versions will be located. Only used for new projects.

sourceFile

the source file to be built. This can be a file pattern (e.g. .rnw$) so that multiple files of the same type can be built or a single file. The comparison will be done ignoring case.

properties

list of global properties for the project.

Details

Most interaction with the makeR package will occur through the Project class. Project is an S3 class that defines some generic functions (e.g. print). The Project class contains a number of properties and methods. By convention, properties begin with a capital case letter and methods begin with a lower case letter. Each is accessedd using the dollar sign notation (e.g. myproject$build()). See below for details for each property and method.

See demo('rbloggers') for an interactive example.

Properties:

Methods:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
myProject = Project(name="RBloggers", projectDir=projectDir, properties=list(email=email, passwd=passwd))
myProject$save()
## Create the first version. This will be for summarizing December 2011 posts.
myProject$newVersion(name='2011-12', properties=list(startDate='2011-12-01', endDate='2011-12-31'))
## Add Project property
myProject$addProperty("author", "Jason Bryer")
## Build the initial version.
myProject$build()
myProject$rebuild(builder=builder.tex, sourceFile='rbloggers.tex')
myProject$Builds ## See that the build completed successfully
## Release the latest version
myProject$release(version='2011-12')

## End(Not run)

jbryer/makeR documentation built on May 18, 2019, 7:02 p.m.