Introduction
The ojo_create_project()
function provides a
standardized way to create new R projects for Open Justice Oklahoma. It
sets up a project with our standard directory structure, initializes
version control, and configures common dependencies.
Basic Usage
The simplest way to create a new project is to provide a name and
description:
ojo_create_project(
name = "my-new-project",
description = "A project to analyze court data"
)
This will:
- Create a new GitHub repository from our template
- Clone it to your local machine
- Initialize renv for dependency management
- Set up basic README content
- Make an initial commit and push to GitHub
Function Parameters
name
: The name of your project (required)
description
: A brief description of the project
dir
: Where to create the project (defaults to current
directory)
private
: Whether the GitHub repository should be
private (defaults to TRUE)
packages
: Additional R packages to install (not yet
implemented)
Example with All Parameters
Here’s an example using all available parameters:
ojo_create_project(
name = "court-data-analysis",
description = "Analysis of Oklahoma court data for 2023",
dir = "~/projects",
private = TRUE
)
Requirements
To use this function, you need:
- A GitHub account with access to the OpenJusticeOK organization
- SSH keys configured for GitHub
Common Issues
- If you get authentication errors, make sure your GitHub SSH keys are
properly configured
- Project names should follow R package naming conventions (letters,
numbers, and hyphens)
Future Enhancements
The following features are planned:
- Interactive CLI for project creation
- Support for custom project templates
- Additional project configuration options
- Package dependency management