Skip to content

Commit

Permalink
Examples are now in inst/doc folder
Browse files Browse the repository at this point in the history
  • Loading branch information
atero18 committed Sep 23, 2023
1 parent ece144d commit 9b48a69
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ po/*~
# RStudio Connect folder
rsconnect/

core
*core
docs
inst/doc
2 changes: 1 addition & 1 deletion R/AHR_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#' the connected component.
#' @name AHR
#' @details `r badge('experimental')`
#' @example inst/examples/AHR.R
#' @example inst/doc/ex_AHR.R
#' @export
#' @seealso [merge_cc_partitions()]
#' @seealso [stats::hclust()] if you don't have any constraint.
Expand Down
8 changes: 4 additions & 4 deletions R/arguments.R
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ testContiguityMatrix <- makeTestFunction(checkContiguityMatrix)
#' @name checkContiguityGraph
#' @rdname checkContiguityGraph
#' @family arguments checkers
#' @example inst/examples/checkContiguityGraph.R
#' @example inst/doc/ex_checkContiguityGraph.R
#' @export
#' @importFrom igraph is_igraph is.simple is.directed gorder gsize
checkContiguityGraph <- function(g, n = gorder(g))
Expand Down Expand Up @@ -413,7 +413,7 @@ testContiguityGraph <- makeTestFunction(checkContiguityGraph)
#' @inherit check_general details
#' @family arguments checkers
#' @export
#' @example inst/examples/checkDistanceMatrix.R
#' @example inst/doc/ex_checkDistanceMatrix.R
#' @importFrom checkmate checkMatrix
checkDistanceMatrix <- function(x, # nolint: cyclocomp_linter
isComplete = TRUE,
Expand Down Expand Up @@ -498,7 +498,7 @@ testDistanceMatrix <- makeTestFunction(checkDistanceMatrix)
#' @inherit check_general details
#' @family arguments checkers
#' @export
#' @example inst/examples/checkPartition.R
#' @example inst/doc/ex_checkPartition.R

#' @importFrom checkmate checkIntegerish
checkPartition <- function(x, n = length(x))
Expand Down Expand Up @@ -549,7 +549,7 @@ testPartition <- makeTestFunction(checkPartition)
#' @inherit check_general return
#' @inherit check_general details
#' @family arguments checkers
#' @example inst/examples/checkRegionalisation.R
#' @example inst/doc/ex_checkRegionalisation.R
#' @export
#' @importFrom igraph gorder is_igraph
checkRegionalisation <- function(regionalisation, contiguity)
Expand Down
2 changes: 1 addition & 1 deletion R/contiguity.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ setGeneric("is_connected", igraph::is_connected)
#' @returns TRUE if the set is connected, FALSE otherwise.
#' @seealso [igraph::is_connected()]
#' @keywords internal
#' @example inst/examples/is_connected.R
#' @example inst/doc/ex_is_connected.R
#' @export
#' @importFrom igraph is_connected
setMethod(
Expand Down
2 changes: 1 addition & 1 deletion R/medoids.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NULL
#' @param byName `TRUE` if the returned result should be the row name
#' corresponding to the medoid, `FALSE` if it should be the row number.
#' Ignored if `distances` is not named. (flag)
#' @example inst/examples/medoid.R
#' @example inst/doc/ex_medoid.R
#' @export
medoid <- function(distances, byName = FALSE)
{
Expand Down
4 changes: 2 additions & 2 deletions R/partition_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ setGeneric("nbSingletons")
#' @details This form is also used by [stats::cutree()].
#' @details Two partitions are equivalent if and only if their
#' standardised forms are equal.
#' @example inst/examples/standardize_partition.R
#' @example inst/doc/ex_standardize_partition.R
standardize_partition <- function(partition)
{
clustersIDs <- clustersIDs(partition)
Expand All @@ -96,7 +96,7 @@ standardize_partition <- function(partition)
#' @importFrom checkmate assertVector
#' @export
#'
#' @example inst/examples/equivalent_partitions.R
#' @example inst/doc/ex_equivalent_partitions.R
equivalent_partitions <- function(partition1, partition2)
{
assertVector(partition1, min.len = 1L,
Expand Down
2 changes: 1 addition & 1 deletion R/resolver.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @param maxItTransfers positive integer indicating the maximum number
#' of elements can be transferred.
#' @param ... used for development.
#' @example inst/examples/resolve_unfeasible.R
#' @example inst/doc/ex_resolve_unfeasible.R
#' @export
#' @importFrom checkmate assertFlag
resolve_unfeasible <- function(distances = NULL, contiguity = NULL,
Expand Down
22 changes: 0 additions & 22 deletions inst/examples/AHR.R

This file was deleted.

5 changes: 0 additions & 5 deletions inst/examples/checkContiguityGraph.R

This file was deleted.

5 changes: 0 additions & 5 deletions inst/examples/checkDistanceMatrix.R

This file was deleted.

2 changes: 0 additions & 2 deletions inst/examples/checkPartition.R

This file was deleted.

11 changes: 0 additions & 11 deletions inst/examples/checkRegionalisation.R

This file was deleted.

7 changes: 0 additions & 7 deletions inst/examples/equivalent_partitions.R

This file was deleted.

10 changes: 0 additions & 10 deletions inst/examples/is_connected.R

This file was deleted.

5 changes: 0 additions & 5 deletions inst/examples/medoid.R

This file was deleted.

21 changes: 0 additions & 21 deletions inst/examples/resolve_unfeasible.R

This file was deleted.

3 changes: 0 additions & 3 deletions inst/examples/standardize_partition.R

This file was deleted.

2 changes: 1 addition & 1 deletion inst/exclusions_lintr.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ make_exclusions_lintr <- function()
# Remove some linters for example files
for (exampleFile in exampleFilenames)
{
pathFile <- file.path("inst/examples/", exampleFile)
pathFile <- file.path("inst/doc/", exampleFile)
exclusions_list[[pathFile]] <- list(implicit_integer_linter = Inf,
commented_code_linter = Inf,
undesirable_function_linter = Inf)
Expand Down

0 comments on commit 9b48a69

Please sign in to comment.