Skip to content

Commit

Permalink
Improved error message if equal frequency discretization fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed May 14, 2018
1 parent dc708c4 commit 872678d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/discretize.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ discretize <- function(x, method = "frequency", breaks = 3,
)

if(any(duplicated(breaks)))
stop("Some breaks are not unique, use fewer breaks for the data.")
stop("Some breaks are not unique. Change breaks or consider using method 'fixed'.")

### fix first and last to -/+Inf
if(infinity) {
Expand Down
3 changes: 2 additions & 1 deletion man/discretize.Rd
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
\name{discretize}
\alias{discretize}
\alias{binning}
\alias{discretizeDF}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Convert a Continuous Variable into a Categorical Variable}
\description{
This function implements several basic unsupervised methods to convert continuous variables into a categorical variables (factor) suitable for association rule mining. For convenience, a whole data.frame
This function implements several basic unsupervised methods to convert a continuous variable into a categorical variable (factor) using different binning strategies. For convenience, a whole data.frame
can be discretized (i.e., all numeric columns are discretized).
}
\usage{
Expand Down

0 comments on commit 872678d

Please sign in to comment.