Skip to content

Commit

Permalink
Merge pull request #53 from EcologyR/tibble2dataframe_conv
Browse files Browse the repository at this point in the history
tibble to data frame conversion
  • Loading branch information
iramosgutierrez authored Dec 8, 2023
2 parents 26d8151 + 6507be4 commit edb67de
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions R/badge.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")}
Expand Down
1 change: 1 addition & 0 deletions R/certificate_attendance.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")}
Expand Down
2 changes: 2 additions & 0 deletions R/certificate_participation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")}
Expand Down
1 change: 1 addition & 0 deletions R/collection_label.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")}
Expand Down
2 changes: 1 addition & 1 deletion R/herbarium.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")}
Expand Down
1 change: 1 addition & 0 deletions R/tiny_label.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")}
Expand Down

0 comments on commit edb67de

Please sign in to comment.