scatterMatrix: scatterMatrix

Description Usage Arguments Value Author(s) Examples

View source: R/scatterMatrix.R

Description

scatterMatrix produced a matrix with jittered scatterplots, histograms, and correlation coefficients.

Usage

1
2
scatterMatrix(dat, items=NULL, plotSize=180, sizeMultiplier = 1,
              axisLabels = "none", powerHist=TRUE, ...)

Arguments

dat

A dataframe containing the items in the scale. All variables in this dataframe will be used if items is NULL.

items

If not NULL, this should be a character vector with the names of the variables in the dataframe that represent items in the scale.

plotSize

Size of the final plot in millimeters.

sizeMultiplier

Allows more flexible control over the size of the plot elements

axisLabels

Passed to ggpairs function to set axisLabels.

powerHist

Whether to use the default ggpairs histogram on the diagonal of the scattermatrix, or whether to use the powerHist version.

...

Additional arguments are passed on to powerHist.

Value

An object with the input and several output variables. Most notably:

output$scatterMatrix

A scattermatrix with histograms on the diagonal and correlation coefficients in the upper right half.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
### Note: the 'not run' is simply because running takes a lot of time,
###       but these examples are all safe to run!
## Not run: 

### Generate a datafile to use
exampleData <- data.frame(item1=rnorm(100));
exampleData$item2 <- exampleData$item1+rnorm(100);
exampleData$item3 <- exampleData$item1+rnorm(100);
exampleData$item4 <- exampleData$item2+rnorm(100);
exampleData$item5 <- exampleData$item2+rnorm(100);

### Use all items
scatterMatrix(dat=exampleData);

## End(Not run)

userfriendlyscience documentation built on May 2, 2019, 1:09 p.m.