Skip to content

[Bug]: Empty Column causes error on MODE in Descriptive Statistics. #3405

@asjones987

Description

@asjones987

JASP Version

0.19.3

Commit ID

No response

JASP Module

Descriptives

What analysis are you seeing the problem on?

Mode

What OS are you seeing the problem on?

Windows 11

Bug Description

I am getting the following error when I was going through the Descriptive Statistics for a data set and included MODE. After looking through the data i realized the column was empty. I tested other items in the descriptive statistics and so far I could not get others to fail with an empty column.

Below is the error I received. If you need my dataset I can provide a clean copy. However not sure it needed.

This analysis terminated unexpectedly.
Error in if (!is.na(suppressWarnings(as.numeric(mode)))) {: argument is of length zero
Stack trace
To receive assistance with this problem, please report the message above at: https://jasp-stats.org/bug-reports

Image

Expected Behaviour

No error like median, mean, etc

Steps to Reproduce

have a data set with blank column.
go to Deescriptives and run mode on the blank column.

Mode works fine on other columns.

Log (if any)

Full error with Stack Trace
This analysis terminated unexpectedly.

Error in if (!is.na(suppressWarnings(as.numeric(mode)))) {: argument is of length zero

Stack trace
tryCatchOne(expr, names, parentenv, handlers[[1]])

doTryCatch(return(expr), name, parentenv, handler)

withCallingHandlers(expr = analysis(jaspResults = jaspResults, dataset = dataset, options = options), error = .addStackTrace)

analysis(jaspResults = jaspResults, dataset = dataset, options = options)

.descriptivesDescriptivesTable(dataset, dataset.factors, isNominalText, options, jaspResults, numberMissingSplitBy = numberMissingSplitBy)

.descriptivesDescriptivesTable_subFunction(column, list(Variable = variable), options, shouldAddNominalTextFootnote, shouldAddModeMoreThanOnceFootnote, shouldAddModeContinuousTreatedAsDiscreteFootnote, jaspResults)

To receive assistance with this problem, please report the message above at: https://jasp-stats.org/bug-reports

More Debug Information

No response

Final Checklist

  • I have included a screenshot showcasing the issue, if possible.
  • I have included a JASP file (zipped) or data file that causes the crash/bug, if applicable.
  • I have accurately described the bug, and steps to reproduce it.

Metadata

Metadata

Assignees

Labels

Bug: MediumBugs that don't influence the basic function of the app, but it's better to fix them at some point.Module: jaspDescriptives

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions