Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jun 15, 2024
1 parent 9ef8c18 commit 0135c02
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/bbt_delete_temp_files.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' Delete all the temporary files created by \link{bbt_run_from_model}
#' @inheritParams default_params_doc
#' @return Nothing.
#' @examples
#' if (beautier::is_on_ci() && is_beast2_installed()) {
#' beastier::remove_beaustier_folders()
Expand Down
1 change: 1 addition & 0 deletions R/bbt_self_test.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' Do a self test to verify \link{babette} that works correctly.
#' @inheritParams default_params_doc
#' @return Nothing. Will raise an exception if something is wrong.
#' @author Richèl J.C. Bilderbeek
#' @export
#' @examples
Expand Down
1 change: 1 addition & 0 deletions R/check_beast2_pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' For example, to use a Nested Sampling MCMC, the 'BEAST2' 'NS' package
#' needs to be installed.
#' @inheritParams default_params_doc
#' @return Nothing.
#' @examples
#' if (beautier::is_on_ci() && is_beast2_installed()) {
#' beastier::remove_beaustier_folders()
Expand Down
1 change: 1 addition & 0 deletions R/create_test_ns_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#'
#' Create testing output similar to when running a 'BEAST2' run
#' with nested sampling
#' @return a text of type character vector.
#' @author Richèl J.C. Bilderbeek
#' @seealso Use \link{parse_beast2_output_to_ns} to parse
#' this output to a Nested Sampling result.
Expand Down
1 change: 1 addition & 0 deletions R/prepare_file_creation.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' to sub-sub-sub folders. Create those folders and test
#' if these folders can be written to
#' @inheritParams default_params_doc
#' @return Nothing.
#' @examples
#' # This example will fail on the CRAN
#' # r-oldrel-macos-x86_64 platform
Expand Down
1 change: 1 addition & 0 deletions R/update_babette.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' See \url{https://github.com/richelbilderbeek/babetteinstall}
#' how to do this.
#' @param upgrade Deprecated.
#' @return Nothing.
#' @author Giovanni Laudanno, Richèl J.C. Bilderbeek
#' @export
update_babette <- function(upgrade = "default") {
Expand Down
3 changes: 3 additions & 0 deletions man/bbt_delete_temp_files.Rd

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

3 changes: 3 additions & 0 deletions man/bbt_self_test.Rd

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

3 changes: 3 additions & 0 deletions man/check_beast2_pkgs.Rd

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

3 changes: 3 additions & 0 deletions man/create_test_ns_output.Rd

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

3 changes: 3 additions & 0 deletions man/prepare_file_creation.Rd

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

3 changes: 3 additions & 0 deletions man/update_babette.Rd

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

50 changes: 50 additions & 0 deletions scripts/find_functions_with_missing_rd_tags.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/env Rscript
#
# Find function that are not completely documented
#
# Usage:
#
# ./find_functions_with_missing_rd_tags
# ./find_functions_with_missing_rd_tags [package_name]
#
# Examples:
#
# ./find_functions_with_missing_rd_tags
# ./find_functions_with_missing_rd_tags babette
#
# From https://stat.ethz.ch/pipermail/r-package-devel/2021q2/007106.html

library(tools)

pkg_of_interest <- "babette"

args <- commandArgs(trailingOnly = TRUE)
if (length(args) == 1) pkg_of_interest <- args[1]
print(paste("Find functions in package", pkg_of_interest))

db <- Rd_db(pkg_of_interest)

name <- lapply(db, tools:::.Rd_get_metadata, "name")
alias <- lapply(db, tools:::.Rd_get_metadata, "alias")
value <- lapply(db, tools:::.Rd_get_metadata, "value")

n_aliases <- lengths(alias)
df <- data.frame(
file_name = rep(names(db), n_aliases),
name = rep(unlist(name, use.names = FALSE), n_aliases),
alias = unlist(alias, use.names = FALSE),
has_value = rep(lengths(value) > 0, n_aliases)
)

# Create subsets of the database, and find the aliases that have no values.
# This is trying to allow for the possibility that an alias occurs in more than
# one help file (is this allowed?)

alias_with_value <- subset(df, has_value)
alias_without_value <- subset(df, !has_value)
no_value <- subset(alias_without_value, !alias %in% alias_with_value$alias)

# Find all the exports in the package, and subset the help pages to just those.

exports <- getNamespaceExports(pkg_of_interest)
subset(no_value, alias %in% exports)

0 comments on commit 0135c02

Please sign in to comment.