From 6507be466426e1bd0f243ba64007263a26c729db Mon Sep 17 00:00:00 2001 From: Ignacio Date: Fri, 8 Dec 2023 10:06:24 +0100 Subject: [PATCH] tibble to data frame conversion --- R/badge.R | 1 + R/certificate_attendance.R | 1 + R/certificate_participation.R | 2 ++ R/collection_label.R | 1 + R/herbarium.R | 2 +- R/tiny_label.R | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/R/badge.R b/R/badge.R index c2d4368..e8dd57a 100644 --- a/R/badge.R +++ b/R/badge.R @@ -52,6 +52,7 @@ create_badge <- function(data = NULL, stop("Please provide a data.frame or tibble.") } + if(!(all(class(data)=="data.frame"))){data <- as.data.frame(data)} if (!inherits(data, "data.frame")) {stop("The 'data' object must be a data frame.")} if (is.null(path)) {stop("A folder path must be specified.")} diff --git a/R/certificate_attendance.R b/R/certificate_attendance.R index 2e110f8..42c36ff 100644 --- a/R/certificate_attendance.R +++ b/R/certificate_attendance.R @@ -79,6 +79,7 @@ create_certificate_attendance <- function( stop("A data.frame must be provided.") } + if(!(all(class(data)=="data.frame"))){data <- as.data.frame(data)} if (!inherits(data, "data.frame")) {stop("The 'data' object must be a data frame.")} if (is.null(path)) {stop("A folder path must be specified.")} diff --git a/R/certificate_participation.R b/R/certificate_participation.R index 1aa295b..05c7e74 100644 --- a/R/certificate_participation.R +++ b/R/certificate_participation.R @@ -88,6 +88,8 @@ create_certificate_participation <- function( if (is.null(data)) { stop("A data.frame must be provided.") } + + if(!(all(class(data)=="data.frame"))){data <- as.data.frame(data)} if (!inherits(data, "data.frame")) {stop("The 'data' object must be a data frame.")} if (is.null(path)) {stop("A folder path must be specified.")} diff --git a/R/collection_label.R b/R/collection_label.R index c87cebc..4bf0ea3 100644 --- a/R/collection_label.R +++ b/R/collection_label.R @@ -66,6 +66,7 @@ create_collection_label <- function(data = NULL, stop("Please provide a data.frame or tibble.") } + if(!(all(class(data)=="data.frame"))){data <- as.data.frame(data)} if (!inherits(data, "data.frame")) {stop("The 'data' object must be a data frame.")} if (is.null(path)) {stop("A folder path must be specified.")} diff --git a/R/herbarium.R b/R/herbarium.R index 5899797..a256d09 100644 --- a/R/herbarium.R +++ b/R/herbarium.R @@ -104,7 +104,7 @@ create_herbarium_label <- function(data = data, if (is.null(data)) { stop("Please provide a data.frame or tibble.") } - + if(!(all(class(data)=="data.frame"))){data <- as.data.frame(data)} if (!inherits(data, "data.frame")) {stop("The 'data' object must be a data frame.")} if (is.null(path)) {stop("A folder path must be specified.")} diff --git a/R/tiny_label.R b/R/tiny_label.R index 9c9ac54..4d6b16f 100644 --- a/R/tiny_label.R +++ b/R/tiny_label.R @@ -58,6 +58,7 @@ create_tinylabel <- function(data = NULL, stop("Please provide a data.frame or tibble.") } + if(!(all(class(data)=="data.frame"))){data <- as.data.frame(data)} if (!inherits(data, "data.frame")) {stop("The 'data' object must be a data frame.")} if (is.null(path)) {stop("A folder path must be specified.")}