R: Barplot of validatorComparison object

barplot,validatorComparison-method {validate} | R Documentation

## Barplot of validatorComparison object

### Description

The performance of versions of a data set with regard to rule-based quality requirements can be compared using using `compare`. The result is a `validatorComparison` object. This method creates a stacked bar plot of the results. See also `plot,validatorComparison-method` for a line chart.

### Usage

    ## S4 method for signature 'validatorComparison'
    barplot(
      height,
      las = 1,
      cex.axis = 0.8,
      cex.legend = cex.axis,
      wrap = TRUE,
      ...
    )

### Arguments

`height` | object of class `validatorComparison`
`las` | [`numeric`] in `{0,1,2,3}` determining axis label rotation
`cex.axis` | [`numeric`] Magnification with respect to the current setting of `cex` for axis annotation.
`cex.legend` | [`numeric`] Magnification with respect to the current setting of `cex` for legend annotation and title.
`wrap` | [`logical`] Toggle wrapping of x-axis labels when their width exceeds the width of the column.
`...` | Graphical parameters passed to `barplot.default`.

### Note

Before plotting, underscores (`_`) and dots (`.`) in x-axis labels are replaced with spaces.

### See Also

Other comparing: `as.data.frame,cellComparison-method`, `as.data.frame,validatorComparison-method`, `barplot,cellComparison-method`, `cells()`, `compare()`, `match_cells()`, `plot,cellComparison-method`, `plot,validatorComparison-method`

### Examples

    data(retailers)

    rules <- validator(turnover >=0, staff>=0, other.rev>=0)

    # start with raw data
    step0 <- retailers

    # impute turnovers
    step1 <- step0
    step1$turnover[is.na(step1$turnover)] <- mean(step1$turnover,na.rm=TRUE)

    # flip sign of negative revenues
    step2 <- step1
    step2$other.rev <- abs(step2$other.rev)

    # create an overview of differences, comparing to the previous step
    compare(rules, raw = step0, imputed = step1, flipped = step2, how="sequential")

    # create an overview of differences compared to raw data
    out <- compare(rules, raw = step0, imputed = step1, flipped = step2)
    out

    # graphical overview
    plot(out)
    barplot(out)

    # transform data to data.frame (easy for use with ggplot)
    as.data.frame(out)

[Package validate version 0.9.3 Index]