Skip to content

Commit 571a7e0

Browse files
committed
fixes for empty dataset
1 parent e895a83 commit 571a7e0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

R/dataset.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ loadCorrectDataset <- function(x) {
22
if (is.matrix(x) || is.data.frame(x)) {
33
return(x)
44
} else if (is.character(x)) {
5-
if (! endsWith(x, ".csv")) {
5+
if (!endsWith(x, ".csv")) {
66
x <- paste0(x, ".csv")
77
}
88

@@ -50,6 +50,11 @@ findAllColumnNamesInOptions <- function(options, allColumnNames) {
5050

5151
preloadDataset <- function(datasetPathOrObject, options) {
5252

53+
if (is.null(datasetPathOrObject)) {
54+
.setInternal("preloadedDataset", data.frame())
55+
return()
56+
}
57+
5358
dataset <- loadCorrectDataset(datasetPathOrObject)
5459

5560
# repair any names like "", which cause false positives in findAllColumnNamesAndTypes

R/run.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#'
5555
#'
5656
#' @export runAnalysis
57-
runAnalysis <- function(name, dataset, options, view = TRUE, quiet = FALSE, makeTests = FALSE) {
57+
runAnalysis <- function(name, dataset = NULL, options, view = TRUE, quiet = FALSE, makeTests = FALSE) {
5858
if (is.list(options) && is.null(names(options)) && any(names(unlist(lapply(options, attributes))) == "analysisName"))
5959
stop("The provided list of options is not named. Did you mean to index in the options list (e.g., options[[1]])?")
6060

0 commit comments

Comments
 (0)