diff --git a/R/create_project.R b/R/create_project.R index 96143b6..722741f 100644 --- a/R/create_project.R +++ b/R/create_project.R @@ -175,79 +175,7 @@ create_project <- function( # Create the readme ----- - readme_content <- c( - "# Readme", - "This is the template for a standard data analysis.", - "Please give an overview what you do in this project and how to ", - "navigate it.", - "", - "## Introduction", - "TODO: Give a short introduction of your project.", - "Let this section explain the objectives or the motivation behind ", - "this project.", - "", - "## Getting Started", - "TODO: Guide users through getting your code up and running on their ", - "own system. ", - "In this section you can talk about:", - "1. Installation process", - "2. Software dependencies", - "3. Latest releases", - "4. API references", - "", - "# Build and Test", - "TODO: Describe and show how to build your code and run the tests.", - "", - "# Contribute", - "TODO: Explain how other users and developers can contribute to make ", - "your code better.", - "", - "## Git integration", - "If you want to use git with your project (you should!), ", - "please do the following steps (replace `` with ", - "the actual name):", - "", - "1. Go to your git repository provider (GitHub/Azure DevOps) and create ", - "a new repository", - "2. DON'T check 'Add a README file'", - "3. Go to the Terminal within RStudio and type the following commands ", - "(for the URL, e.g. https://github.com):", - "", - "```bash", - "git init", - "git branch -M main", - "git remote add origin /.git", - "```", - "", - "4. Restart RStudio", - "5. Type in the R terminal `bash git add .` to add all files to ", - "the commit", - "6. Type in the R terminal `bash git commit -m ", - "'Your commit message (initial commit)'` to commit those files with ", - "a message.", - "7. In the terminal, execute the following command:", - "", - "```bash", - "git push -u origin main", - "```", - "", - "8. For the following commits, repeat this process", - "", - "NOTE: For sharing content on GitHub you should have ticked the ", - "'Create a .gitignore file for GitHub' checkbox when creating the project.", - "This will give create a strict .gitignore which is suitable for sharing ", - "code to the public.", - "Please also review to ensure no sensitive information is shared.", - "", - "For more information about the integration of git and RStudio, ", - "check out https://happygitwithr.com." - ) - - # Write to README.md - readme_concat <- paste0(readme_content, collapse = "\n") - writeLines(readme_concat, con = file.path(path, "README.md")) - + file.copy("README_template.md", file.path(path, "README.md")) # .renvignore file.create(paste0(path, "/.renvignore")) diff --git a/README_template.md b/README_template.md new file mode 100644 index 0000000..9329906 --- /dev/null +++ b/README_template.md @@ -0,0 +1,32 @@ +# Readme template + +*This is the README template for a publication project. Please update the italicised text in each section below with the specific details for your publication. You can find more information on why you should have a README file on the* [RAP for statistics](https://dfe-analytical-services.github.io/analysts-guide/RAP/rap-statistics.html) *page of the Analysts' Guide.* + +*Once you have added your information, ensure all italicised text is deleted.* + +## Introduction + +- Purpose: *briefly explain the purpose of the code.* +- Overview: *Provide a high-level summary of the contents and structure of the repository.* + +## Requirements + +- Access: *Detail any permissions or access needed to use the repository at the top of this section, e.g. access to specific SQL databases. This is crucial for enabling new users to use the repository.* +- Skills/knowledge: *Outline the required skills or knowledge, such as familiarity with specific packages in R, or SQL.* +- Version control/Renv: *State how version control is managed and whether Renv is being used.* + +## Getting started + +- Setup instructions: *Provide step-by-step instructions on how to set up the environment, including installing dependencies.* +- Data input/output: *Describe the expected input data and where it can be found, as well as what output should be expected from the code.* + +## How to run and update + +- Running the code: *Explain how users can best run the code, for example by running a run all script.* +- Updating guidelines: *Outline the process for updating and contributing to the repository, including specific scripts and lines where updates are frequently needed. Describe how to get changes reviewed.* +- Issue reporting: *Explain how to report issues or suggest improvements. This could be through issues if using GitHub, boards in Azure DevOps or by emailing the team.* + +## Contact details + +- Main contacts: *List the names and contact information of people who maintain the repository.* +- Support channels: *Provide any information on how to get support, such as email addresses or teams channels.*