1 |
#' @title A short description of the function |
|
2 |
#' @description A long description of what the function do |
|
3 |
#' @concept AConceptWhichCanBeUsedForDoc |
|
4 |
#' @concept AnotherConceptWhichCanBeUsedForDoc |
|
5 |
#' @param i Description of the function parameter |
|
6 |
#' @return Description of what, and eventually in which type, the function return |
|
7 |
#' @examples |
|
8 |
#' # Some lines of code illustrating the usage of the function. |
|
9 |
#' # This code must be runnable without changes. |
|
10 |
#' # To add files to use with example, place it in inst/examplesdata |
|
11 |
#' # and load it with: |
|
12 |
#' exampleDir <- system.file("examplesdata", package = "myPackageName", mustWork = TRUE) |
|
13 |
#' exampleFile <- file.path(exampleDir, "exampleData.csv") |
|
14 |
#' data <- read.csv(exampleFile) |
|
15 |
#' |
|
16 |
#' myExampleFunction(data[1, 1]) |
|
17 |
#' # Print: 25 |
|
18 |
#' @export |
|
19 |
myExampleFunction <- function(i) { |
|
20 | 1x |
return(i * i) |
21 |
} |
|
22 |
#' @title A short description of the function |
|
23 |
#' @description A long description of what the function do |
|
24 |
#' @concept AConceptWhichCanBeUsedForDoc |
|
25 |
#' @param j Description of the function parameter |
|
26 |
#' @param fileOut File where to put the results |
|
27 |
#' @return Nothing |
|
28 |
#' @examples |
|
29 |
#' exampleDir <- system.file("examplesdata", package = "myPackageName", mustWork = TRUE) |
|
30 |
#' outputDir <- file.path(exampleDir, "outputs") |
|
31 |
#' if (!file.exists(outputDir)) { |
|
32 |
#' dir.create(path = outputDir) |
|
33 |
#' } |
|
34 |
#' filepath <- file.path(outputDir, "output.csv") |
|
35 |
#' myPackageName:::myExampleInternalFunction(j = 4, fileOut = filepath) |
|
36 |
#' @keywords Internal |
|
37 |
myExampleInternalFunction <- function(j, fileOut) { |
|
38 | 1x |
utils::write.csv(x = data.frame(data = j * 2), file = fileOut, row.names = FALSE) |
39 |
} |