Skip to content

Commit

Permalink
finish up adding dataset_names()/register_dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferis committed Jun 28, 2023
1 parent 4a110f2 commit 594512d
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Generated by roxygen2: do not edit by hand

export(cosine_sim)
export(dataset_names)
export(id2char)
export(partner_summary2adjacency_matrix)
export(prepare_cosine_matrix)
export(register_dataset)
importFrom(grDevices,hcl.colors)
importFrom(stats,as.dist)
importFrom(stats,hclust)
Expand Down
16 changes: 12 additions & 4 deletions R/datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
#' only used for testing purposes.
#' @param ... Additional named arguments specifying properties of the dataset
#'
#' @return
#' @return No return value. Called for its side effect.
#' @export
#'
#' @examples
#' \dontrun{
#' # partial example. metafun and partnerfun are pretty important to specify
#' register_dataset("flywire", shortname='fw', species='Drosophila melanogaster', sex='F', age="adult")
#' }
register_dataset <- function(name, shortname=NULL, species=NULL,
sex=c("F", "M", "H", "U"), age=NULL,
idfun=NULL, metafun=NULL, partnerfun=NULL,
Expand Down Expand Up @@ -74,13 +78,17 @@ dataset_namespace <- function(namespace='default') {
#' Return dataset names either all or those matching a query
#'
#' @param query A character vector partially matched against dataset names
#' @param short Whether to match (and return) short names
#' @param namespace
#' @param namespace Optional character vector specifying a namespace used to
#' organise datasets (advanced use only).
#' @param return.short Whether to return the long or short name
#' @param match Whether the query should match against long or short forms of
#' the dataset name.
#'
#' @return
#' @return A character vector of names
#' @export
#'
#' @examples
#' dataset_names()
dataset_names <- function(query=NULL, return.short=FALSE, match=c("both", "long", "short"), namespace='default') {

ns=dataset_namespace(namespace)
Expand Down
33 changes: 33 additions & 0 deletions man/dataset_names.Rd

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

58 changes: 58 additions & 0 deletions man/register_dataset.Rd

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

0 comments on commit 594512d

Please sign in to comment.