powered by
Categorises a numeric vector into automatic or manually defined categories and polishes the labels ready for used in mapping with ggplot2.
ggplot2
cut_to_classes( x, n = 5, style = "equal", manual = FALSE, manual_breaks = NULL, decimals = 0, nodata_label = "No data" )
A numeric vector, eg. values variable in data returned by get_eurostat().
values
get_eurostat()
A numeric. number of classes/categories
chosen style: one of "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", "dpih" or "headtails"
Logical. If manual breaks are being used
Numeric vector with manual threshold values
Number of decimals to include with labels
String. Text label for NA category.
a factor.
classInt::classIntervals()
Other helpers: dic_order(), eurotime2date(), eurotime2num(), harmonize_country_code(), label_eurostat()
dic_order()
eurotime2date()
eurotime2num()
harmonize_country_code()
label_eurostat()
# NOT RUN { # lp <- get_eurostat("nama_aux_lp") lp <- get_eurostat("nama_10_lp_ulc") lp$class <- cut_to_classes(lp$values, n = 5, style = "equal", decimals = 1) # }
Run the code above in your browser using DataLab