diff --git a/R/dataset_to_triples.R b/R/dataset_to_triples.R index 6237e4c..2b127b8 100644 --- a/R/dataset_to_triples.R +++ b/R/dataset_to_triples.R @@ -17,7 +17,7 @@ dataset_to_triples <- function(x, idcol=NULL) { is_dataset <- inherits(x, "dataset_df") if (is_dataset) { - new_title < paste0(dataset_title(x), " [triple form]") + new_title <- paste0(dataset_title(x), " [triple form]") DataBibentry <- get_bibentry(x) new_Subject <- subject(x) } diff --git a/R/defined.R b/R/defined.R index a5ee14c..24e1edb 100644 --- a/R/defined.R +++ b/R/defined.R @@ -80,7 +80,7 @@ defined <- function(x, #' @rdname defined #' @export is.defined <- function(x) { - any( inherits(x, "haven_labelled_defined"), inherits(x, "datetime_defined")) + any(inherits(x, "haven_labelled_defined"), inherits(x, "datetime_defined")) } #' From haven diff --git a/R/subject.R b/R/subject.R index 97fc376..8c30768 100644 --- a/R/subject.R +++ b/R/subject.R @@ -72,7 +72,7 @@ subject_create <- function(term, #} if (length(term)>1) { - dataset_subject <- lapply (1:length(term), function(x) new_Subject(term[x], + dataset_subject <- lapply (1:seq_along(term), function(x) new_Subject(term[x], subjectScheme = subjectScheme[x], schemeURI = schemeURI[x], classificationCode = classificationCode[x], diff --git a/tests/testthat/test-var_namespace.R b/tests/testthat/test-var_namespace.R index 5916edc..342cbaf 100644 --- a/tests/testthat/test-var_namespace.R +++ b/tests/testthat/test-var_namespace.R @@ -19,8 +19,8 @@ test_that("set_namespace_attribute() works", { test_that("`var_namespace<-` works", { - var_namespace(qid) <- "https://www.wikibase.se/" qid <- defined(c("Q275912", "Q116196078"), namespace = "https://www.wikidata.org/wiki/") + var_namespace(qid) <- "https://www.wikibase.se/" expect_equal(get_namespace_attribute(qid), "https://www.wikibase.se/") expect_error(var_namespace(qid) <- c("https://www.wikidata.org/wiki/", "https://www.wikiba.se/")) })