Skip to content

Commit

Permalink
fix issue with data.table
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed Apr 20, 2021
1 parent ca2231c commit d11e880
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mschart
Type: Package
Title: Chart Generation for 'Microsoft Word' and 'Microsoft PowerPoint' Documents
Version: 0.3.0
Version: 0.3.1.001
Authors@R: c(
person("David", "Gohel", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down
3 changes: 3 additions & 0 deletions R/ms_chart.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ ms_chart <- function(data, x, y, group = NULL, labels = NULL, excel_data_setup =
stopifnot(x %in% names(data))
stopifnot(y %in% names(data))

if( inherits(data, "data.table") || inherits(data, "tbl_df") || inherits(data, "tbl") )
data <- as.data.frame(data, stringsAsFactors = FALSE)

if( !is.null(group) && !(group %in% names(data)) ){
stop("column ", shQuote(group), " could not be found in data.", call. = FALSE)
}
Expand Down

0 comments on commit d11e880

Please sign in to comment.