-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4867fe6
commit 4057ae3
Showing
5 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' @title Get the bibliographic entries of a dataset | ||
#' @description A dataset constructed with \code{\link{dataset}} records most of the | ||
#' dataset-level metadata in an bibentry object, which allows the printing or saving | ||
#' the bibliographic record in HTML, BibLatex and other formats. | ||
#' For further information on | ||
#' the \code{bibentry} class see \code{utils::\link[utils]{bibentry}}. | ||
#' @param ds A dataset object created by \code{\link{dataset}}. | ||
#' @return The \code{\link[utils]{bibentry}} object of the dataset. | ||
#' @importFrom utils bibentry | ||
#' @examples | ||
#' ds <- dataset(iris, | ||
#' title = "The iris Dataset", | ||
#' author = c( | ||
#' person(family ="Anderson", | ||
#' given ="Edgar", | ||
#' role = "aut") | ||
#' ), | ||
#' identifier = "https://doi.org/10.1111/j.1469-1809.1936.tb02137.x", | ||
#' year = "1935", | ||
#' version = "1.0", | ||
#' description = "The famous dataset that is distributed with R.", | ||
#' url = "https://en.wikipedia.org/wiki/Iris_flower_data_set", | ||
#' resourceType = "Dataset" | ||
#' ) | ||
#' print(ds, style="text") | ||
#' print(ds, style="Bibtex") | ||
#' @export | ||
|
||
dataset_bibentry <- function(ds) { | ||
attr(ds, "DataBibentry") | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ds <- dataset(iris, | ||
title = "The iris Dataset", | ||
author = c( | ||
person(family ="Anderson", | ||
given ="Edgar", | ||
role = "aut") | ||
), | ||
identifier = "https://doi.org/10.1111/j.1469-1809.1936.tb02137.x", | ||
year = "1935", | ||
version = "1.0", | ||
description = "The famous dataset that is distributed with R.", | ||
url = "https://en.wikipedia.org/wiki/Iris_flower_data_set", | ||
resourceType = "Dataset" | ||
) | ||
|
||
test_that("multiplication works", { | ||
expect_equal(class(dataset_bibentry(ds)), "bibentry") | ||
}) |