Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps to add license #20

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
RoxygenNote: 7.3.2
Imports:
rmarkdown
31 changes: 3 additions & 28 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
BSD 3-Clause License

Copyright (c) 2024, Imperial College London

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
YEAR: 2025
COPYRIGHT HOLDER: Imperial College London
ORGANIZATION: Imperial College London
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Generated by roxygen2: do not edit by hand

export(add)
export(filename)
13 changes: 0 additions & 13 deletions R/add.R

This file was deleted.

10 changes: 10 additions & 0 deletions R/filename.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#' Function to modify a file path
#'
#' @param path A character string
#'
#' @return A character string
#' @export
filename <- function(path) {
modified_path <- paste0("R/", path)
return(modified_path)
}
7 changes: 4 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ git push --set-upstream origin main
## Update `DESCRIPTION` file

- The `DESCRIPTION` file contains the metadata of your package. You can add some descriptive text about your package under `Title` and `Description` fields. You can also fill in the author and maintainer details.
- Manually add BSD-3-Clause license (recommended) first to your repository and then to the `DESCRIPTION` file.
- Create a LICENSE file in your repository using the [template for the BSD 3-clause license](https://www.r-project.org/Licenses/BSD_3_clause) (recommended).
- Then edit the `License` tag in the `DESCRIPTION` file to include `BSD_3_clause + file LICENSE`.
- Run `devtools::check()` to verify if everything works (As of now, it raises a note "Licence stub is invalid DCF.")

## Build a README
Expand All @@ -97,13 +98,13 @@ git push --set-upstream origin main
## Add R files and corresponding unit tests

- Create a R function file using `usethis::use_r("filename")`.
- A `filename.R` file will be created under the `R/` directory which you can populate.
- A `filename.R` file will be created under the `R/` directory which you can populate (In this case, as an example, it is populated with a function to modify a file path).
- Create a corresponding unit test file using `usethis::use_test("filename")`.
- A `test-filename.R` file will be created under the `tests/testthat/` directory where you can add the unit tests.

## Setup documentation

- Use `devtools::document` to set up the documentation for your package.
- Use `devtools::document()` to set up the documentation for your package.
- Delete the template `R/hello.R` file.
- Now open any other R file (that you created) where you want add the documentation (here it is, the `R/add.R` file).
- Put the cursor somewhere in the function definition. Then do, `Code > Insert roxygen skeleton`. A comment structure should appear above your function, in which each line begins with #'.
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ repo](https://happygitwithr.com/existing-github-last.html#create-and-connect-a-g
add some descriptive text about your package under `Title` and
`Description` fields. You can also fill in the author and maintainer
details.
- Manually add BSD-3-Clause license (recommended) first to your
repository and then to the `DESCRIPTION` file.
- Create a LICENSE file in your repository using the [template for the
BSD 3-clause license](https://www.r-project.org/Licenses/BSD_3_clause)
(recommended).
- Then edit the `License` tag in the `DESCRIPTION` file to include
`BSD_3_clause + file LICENSE`.
- Run `devtools::check()` to verify if everything works (As of now, it
raises a note “Licence stub is invalid DCF.”)

Expand All @@ -143,15 +146,17 @@ repo](https://happygitwithr.com/existing-github-last.html#create-and-connect-a-g

- Create a R function file using `usethis::use_r("filename")`.
- A `filename.R` file will be created under the `R/` directory which you
can populate.
can populate (In this case, as an example, it is populated with a
function to modify a file path).
- Create a corresponding unit test file using
`usethis::use_test("filename")`.
- A `test-filename.R` file will be created under the `tests/testthat/`
directory where you can add the unit tests.

## Setup documentation

- Use `devtools::document` to set up the documentation for your package.
- Use `devtools::document()` to set up the documentation for your
package.
- Delete the template `R/hello.R` file.
- Now open any other R file (that you created) where you want add the
documentation (here it is, the `R/add.R` file).
Expand Down
22 changes: 0 additions & 22 deletions man/add.Rd

This file was deleted.

17 changes: 17 additions & 0 deletions man/filename.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading