-
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.
New devel-branch with from the sandbox repo dsdev
- Loading branch information
1 parent
9305b34
commit c8bf715
Showing
18 changed files
with
328 additions
and
895 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ inst/doc | |
not_included/ | ||
/doc/ | ||
/Meta/ | ||
|
||
old-functions/ |
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,58 @@ | ||
|
||
#' @rdname dataset | ||
#' @export | ||
as_dataset <- function(x, | ||
author, | ||
title, | ||
publisher = NULL, | ||
year = NULL, | ||
identifier = NULL, | ||
description = NULL, | ||
version = NULL, | ||
subject = NULL, | ||
language = NULL) { | ||
UseMethod("as_dataset", x) | ||
} | ||
|
||
#' @rdname dataset | ||
#' @importFrom utils bibentry | ||
#' @export | ||
as_dataset.data.frame <- function(x, | ||
author, | ||
title, | ||
publisher = NULL, | ||
year = NULL, | ||
identifier = NULL, | ||
description = NULL, | ||
version = NULL, | ||
subject = NULL, | ||
language = NULL) { | ||
|
||
assertthat::assert_that(inherits(author, "person"), | ||
msg="The person person must be created with utils::person().") | ||
|
||
if (is.null(year)) year <- substr(as.character(Sys.Date()), 1,4) | ||
if (is.null(version)) version <- "0.1.0" else version <- as.character(version) | ||
if (is.null(publisher)) publisher <- ":tba" | ||
if (is.null(identifier)) identifier <- ":tba" | ||
if (is.null(description)) description <- ":unas" | ||
if (is.null(language)) language <- ":unas" | ||
if (is.null(subject)) subject <- new_Subject(NULL) | ||
|
||
DataBibentry <- utils::bibentry(bibtype="Misc", | ||
title = title, | ||
author = author, | ||
publisher = publisher, | ||
year = year, | ||
resourceType = "Dataset", | ||
identifier = identifier, | ||
version = version, | ||
description = description, | ||
language = language | ||
) | ||
|
||
new_dataset(x, | ||
DataBibentry = DataBibentry, | ||
subject = subject) | ||
|
||
} |
Oops, something went wrong.