Description Usage Arguments Details Value Note See Also Examples

View source: R/mf_get_breaks.R

A function to classify continuous variables.

1 | ```
mf_get_breaks(x, nbreaks, breaks, k = 1, central = FALSE, ...)
``` |

`x` |
a vector of numeric values |

`nbreaks` |
a number of classes |

`breaks` |
a classification method; one of "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", "dpih", "q6", "geom", "arith", "em" or "msd" (see Details). |

`k` |
number of standard deviation for "msd" method (see Details) |

`central` |
creation of a central class for "msd" method (see Details) |

`...` |
further arguments
of |

"fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust",
"bclust", "fisher", "jenks" and "dpih"
are `classIntervals`

methods. You may need to pass additional arguments for some of them.

Jenks ("jenks" method) and Fisher ("fisher" method) algorithms are
based on the same principle and give
quite similar results but Fisher is much faster.

The "q6" method uses the following `quantile`

probabilities: 0, 0.05, 0.275, 0.5, 0.725, 0.95, 1.

The "geom" method is based on a geometric progression along
the variable values.

The "arith" method is based on an arithmetic progression along
the variable values.

The "em" method is based on nested averages computation.

The "msd" method is based on the mean and the standard deviation
of a numeric vector.
The `nbreaks`

parameter is not relevant, use `k`

and
`central`

instead. `k`

indicates
the extent of each class in share of standard deviation.
If `central=TRUE`

then
the mean value is the center of a class else the mean is a break value.

A numeric vector of breaks

This function is mainly a wrapper
of `classIntervals`

+
"arith", "em", "q6", "geom" and "msd" methods.

classIntervals

1 2 | ```
mtq <- mf_get_mtq()
mf_get_breaks(x = mtq$MED, nbreaks = 6, breaks = "quantile")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.