Skip to content

Commit

Permalink
Addresses spell check warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz-zz committed Jul 12, 2019
1 parent a557e6e commit 8d8b11b
Show file tree
Hide file tree
Showing 22 changed files with 146 additions and 144 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: A tool for exploring correlations.
It makes it possible to easily perform routine tasks when
exploring correlation matrices such as ignoring the diagonal,
focusing on the correlations of certain variables against others,
or rearranging and visualising the matrix in terms of the
or rearranging and visualizing the matrix in terms of the
strength of the correlations.
Authors@R:
c(person(given = "Edgar",
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- Improves `correlate()` for database backed tables

- Fixes compatability issues with `dplyr`
- Fixes compatibility issues with `dplyr`

# corrr 0.3.2

Expand Down Expand Up @@ -52,7 +52,7 @@ The `diagonal` argument of `as_matrix` and `as_matrix.cor_df` is now an optional

## Fixes

- When `legend = TRUE` (now the default setting), `rplot` and `network_plot` generate a single, unlabelled legend referring to the size of the correlations.
- When `legend = TRUE` (now the default setting), `rplot` and `network_plot` generate a single, unlabeled legend referring to the size of the correlations.

## Other

Expand Down
2 changes: 1 addition & 1 deletion R/correlate.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' \item A tibble (see \code{\link[tibble]{tibble}})
#' \item An additional class, "cor_df"
#' \item A "rowname" column
#' \item Standardised variances (the matrix diagonal) set to missing values by
#' \item Standardized variances (the matrix diagonal) set to missing values by
#' default (\code{NA}) so they can be ignored in calculations.
#' }
#'
Expand Down
8 changes: 4 additions & 4 deletions R/output.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ fashion.default <- function(x, decimals = 2, leading_zeros = FALSE, na_print = "
#'
#' @param rdf Correlation data frame (see \code{\link{correlate}}) or object
#' that can be coerced to one (see \code{\link{as_cordf}}).
#' @param legend Boolean indicating whether a legend mapping the colours to the correlations should be displayed.
#' @param legend Boolean indicating whether a legend mapping the colors to the correlations should be displayed.
#' @param shape \code{\link{geom_point}} aesthetic.
#' @param print_cor Boolean indicating whether the correlations should be printed over the shapes.
#' @param colours,colors Vector of colours to use for n-colour gradient.
#' @param colours,colors Vector of colors to use for n-color gradient.
#' @return Plots a correlation data frame
#' @export
#' @examples
Expand Down Expand Up @@ -104,13 +104,13 @@ rplot.default <- function(rdf, ...) {
#'
#' Output a network plot of a correlation data frame in which variables that are
#' more highly correlated appear closer together and are joined by stronger
#' paths. Paths are also coloured by their sign (blue for positive and red for
#' paths. Paths are also colored by their sign (blue for positive and red for
#' negative). The proximity of the points are determined using multidimensional
#' clustering.
#'
#' @param min_cor Number from 0 to 1 indicating the minimum value of
#' correlations (in absolute terms) to plot.
#' @param colours,colors Vector of colours to use for n-colour gradient.
#' @param colours,colors Vector of colors to use for n-color gradient.
#' @param repel Should variable labels repel each other? If TRUE, text is added
#' via \code{\link[ggrepel]{geom_text_repel}} instead of \code{\link[ggplot2]{geom_text}}
#' @param curved Should the paths be curved? If TRUE, paths are added via
Expand Down
4 changes: 2 additions & 2 deletions R/reshape.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ focus_ <- function(x, ..., .dots, mirror) {

#' Conditionally focus correlation data frame
#'
#' Apply a predicate function to each colum of correlations. Columns that
#' Apply a predicate function to each column of correlations. Columns that
#' evaluate to TRUE will be included in a call to \code{\link{focus}}.
#'
#' @param x Correlation data frame or object to be coerced to one via
Expand Down Expand Up @@ -104,7 +104,7 @@ focus_if.default <- function(x, .predicate, ..., mirror = FALSE) {
#' matrix diagonal) should be dropped? Will automatically be set to TRUE if
#' mirror is FALSE.
#' @param remove.dups Removes duplicate entries, without removing all NAs
#' @return tbl with three colums (x and y variables, and their correlation)
#' @return tbl with three columns (x and y variables, and their correlation)
#' @export
#' @examples
#' x <- correlate(mtcars)
Expand Down
2 changes: 1 addition & 1 deletion R/retract.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Creates a data frame from a streched correlation table
#' Creates a data frame from a stretched correlation table
#'
#' \code{retract} does the opposite of what \code{stretch} does
#'
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Using `corrr` typically starts with `correlate()`, which acts like the base corr

- A `tbl` with an additional class, `cor_df`
- An extra "rowname" column
- Standardised variances (the matrix diagonal) set to missing values (`NA`) so they can be ignored.
- Standardized variances (the matrix diagonal) set to missing values (`NA`) so they can be ignored.

### API

Expand All @@ -59,7 +59,7 @@ Reshape structure (`tbl` or `cor_df` out):
- `focus()` on select columns and rows.
- `stretch()` into a long format.

Output/visualisations (console/plot out):
Output/visualizations (console/plot out):

- `fashion()` the correlations for pretty printing.
- `rplot()` the correlations with shapes in place of the values.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ following structure:

- A `tbl` with an additional class, `cor_df`
- An extra “rowname” column
- Standardised variances (the matrix diagonal) set to missing values
- Standardized variances (the matrix diagonal) set to missing values
(`NA`) so they can be ignored.

### API
Expand All @@ -66,7 +66,7 @@ Reshape structure (`tbl` or `cor_df` out):
- `focus()` on select columns and rows.
- `stretch()` into a long format.

Output/visualisations (console/plot out):
Output/visualizations (console/plot out):

- `fashion()` the correlations for pretty printing.
- `rplot()` the correlations with shapes in place of the values.
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Adds `dice()` function, wraps `focus(x,..., mirror = TRUE)`
* Adds `retract()` function, opposite of `stretch()`
* Improves `correlate()` for database backed tables
* Fixes compatability issues with `dplyr`
* Fixes compatibility issues with `dplyr`

## Test environments
* Local windows 10 install, R 3.6.0
Expand Down
2 changes: 1 addition & 1 deletion man/correlate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/corrr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/focus_if.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/network_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/retract.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/rplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/stretch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tools/readme/combination-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/readme/combination-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions vignettes/using-corrr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ library(corrr)
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
```

corrr is a package for exploring **corr**elations in **R**. It makes it possible to easily perform routine tasks when exploring correlation matrices such as ignoring the diagonal, focusing on the correlations of certain variables against others, or rearranging and visualising the matrix in terms of the strength of the correlations.
corrr is a package for exploring **corr**elations in **R**. It makes it possible to easily perform routine tasks when exploring correlation matrices such as ignoring the diagonal, focusing on the correlations of certain variables against others, or rearranging and visualizing the matrix in terms of the strength of the correlations.

## Using corrr

Using `corrr` starts with `correlate()`, which acts like the base correlation function `cor()`. It differs by defaulting to pairwise deletion, and returning a correlation data frame (`cor_df`) of the following structure:

- A `tbl` with an additional class, `cor_df`
- An extra "rowname" column
- Standardised variances (the matrix diagonal) set to missing values (`NA`) so they can be ignored.
- Standardized variances (the matrix diagonal) set to missing values (`NA`) so they can be ignored.

To work with further, let's create a correlation data frame using `correlate()` from the `mtcars` data that comes with R:

Expand All @@ -35,7 +35,7 @@ d

## Why a correlation data frame?

At first, a correlation data frame might seem like an unneccessary complexity compared to the traditional matrix. However, the purpose of corrr is to help use explore these correlations, not to do mathematical or statistical operations. Thus, by having the correlations in a data frame, we can make use of packages that help us work with data frames like `dplyr`, `tidyr`, `ggplot2`, and focus on using data pipelines. Lets look at some examples:
At first, a correlation data frame might seem like an unnecessary complexity compared to the traditional matrix. However, the purpose of corrr is to help use explore these correlations, not to do mathematical or statistical operations. Thus, by having the correlations in a data frame, we can make use of packages that help us work with data frames like `dplyr`, `tidyr`, `ggplot2`, and focus on using data pipelines. Lets look at some examples:

```{r, message=F, warning=F}
library(dplyr)
Expand All @@ -53,7 +53,7 @@ d %>%
select(rowname, mpg, cyl, disp)
```

Furthermore, by having the diagonal set to missing, we don't need to put in extra effort to ignore them when summarising the correlations. For example:
Furthermore, by having the diagonal set to missing, we don't need to put in extra effort to ignore them when summarizing the correlations. For example:

```{r, warning = FALSE, message = FALSE}
# Compute mean of each column
Expand All @@ -77,7 +77,7 @@ Reshape structure (`tbl` or `cor_df` out):
- `focus()` on select columns and rows.
- `stretch()` into a long format.

Output/visualisations (console/plot out):
Output/visualizations (console/plot out):

- `fashion()` the correlations for pretty printing.
- `rplot()` a shape for each correlation.
Expand All @@ -100,7 +100,7 @@ d %>%
fashion() # Print in nice format
```

Alternatively, we can visualise these correlations (let's clear the lower triangle for a change):
Alternatively, we can visualize these correlations (let's clear the lower triangle for a change):

```{r, warning = FALSE}
d %>%
Expand Down
Loading

0 comments on commit 8d8b11b

Please sign in to comment.