Skip to content

Commit

Permalink
prepping for CRAN submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Rinker committed Dec 12, 2017
1 parent 892f489 commit 4a83390
Show file tree
Hide file tree
Showing 36 changed files with 51 additions and 59 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Authors@R: c(person("Tyler", "Rinker", email = "tyler.rinker@gmail.com", role =
Maintainer: Tyler Rinker <tyler.rinker@gmail.com>
Description: Format numbers and plots for publication; includes the removal of leading zeros,
standardization of number of digits, addition of affixes, and a p-value formatter. These
tools combine the functionality of several 'base' functions such as paste(), format(), and
sprintf() into specific use case functions that are named in a way that is consistent with
usage, making their names easy to remember and easy to deploy.
tools combine the functionality of several 'base' functions such as 'paste()', 'format()',
and 'sprintf()' into specific use case functions that are named in a way that is
consistent with usage, making their names easy to remember and easy to deploy.
Depends: R (>= 3.2.0)
Suggests: testthat
Date: 2017-12-11
Date: 2017-12-12
License: GPL-2
LazyData: TRUE
Roxygen: list(wrap = FALSE)
Expand Down
12 changes: 4 additions & 8 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ And constructed with the following guidelines:
* Bug fixes and misc changes bumps the patch


numform 0.3.1 -

numform 0.3.1 - 0.3.3
----------------------------------------------------------------

BUG FIXES
Expand All @@ -29,8 +30,8 @@ NEW FEATURES

* `f_year`, `f_12_hour`, `f_month`, and `f_weekday` (methods based functions)
did not previously have closure, function retuning, forms (i.e., `ff_` form)
making them inconstent in usage. These functions all have a closure, function
retuning, form.
making them inconsistent in usage. These functions all have a closure, function
returning, form.

* `f_quarter` added for working with business quarters.

Expand All @@ -50,11 +51,6 @@ MINOR FEATURES
a vector of regexes to force to be upper/lower regardless of title case.


IMPROVEMENTS

CHANGES




numform 0.0.6 - 0.3.0
Expand Down
12 changes: 4 additions & 8 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ And constructed with the following guidelines:
* Bug fixes and misc changes bumps the patch


numform 0.3.1 -

numform 0.3.1 - 0.3.3
----------------------------------------------------------------

**BUG FIXES**
Expand All @@ -29,8 +30,8 @@ numform 0.3.1 -

* `f_year`, `f_12_hour`, `f_month`, and `f_weekday` (methods based functions)
did not previously have closure, function retuning, forms (i.e., `ff_` form)
making them inconstent in usage. These functions all have a closure, function
retuning, form.
making them inconsistent in usage. These functions all have a closure, function
returning, form.

* `f_quarter` added for working with business quarters.

Expand All @@ -50,11 +51,6 @@ numform 0.3.1 -
a vector of regexes to force to be upper/lower regardless of title case.


**IMPROVEMENTS**

**CHANGES**




numform 0.0.6 - 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion R/alignment.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Many of the specialized functions in numform can change the type of the data
#' from numeric to character causing the table formatting functions in various
#' add-on packages to improperly align the elements. This function pases the
#' add-on packages to improperly align the elements. This function passes the
#' columns with a regular expression to detect alignment regardless of column
#' class.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/as_factor.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @param x A vector of weekdays or months.
#' @param shift Shift the levels to the right or left. Useful for setting the
#' week begining to something besides Sunday. Use -1 to set to Monday instead.
#' week beginning to something besides Sunday. Use -1 to set to Monday instead.
#' @param \ldots ignored.
#' @return Returns a factor vector with levels set.
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/f_12_hour.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Format times to the typical 12 hour '%I:%M %p' in-text format.
#'
#' @param x A vector of coercable times.
#' @param x A vector of coercible times.
#' @param format A character string specifying the time output format.
#' @param pad.char A character to use for leading padding if lengths of output
#' are unequal.
Expand Down
2 changes: 1 addition & 1 deletion R/f_comma.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param mark The character to include every n places.
#' @param prefix A string to append to the front of elements.
#' @param \ldots Other arguments passed to \code{\link[base]{prettyNum}}.
#' @return Returns a comma separted string of publication ready digits.
#' @return Returns a comma separated string of publication ready digits.
#' @export
#' @rdname f_comma
#' @seealso \code{\link[base]{prettyNum}}
Expand Down
2 changes: 1 addition & 1 deletion R/f_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Format dates to the typical '%B %d, %Y in-text format.
#'
#' @param x A vector of coercable dates.
#' @param x A vector of coercible dates.
#' @param format A character string specifying the date output format.
#' @param \ldots Other arguments passed to \code{\link[base]{as.Date}}.
#' @return Returns a string of publication ready dates.
Expand Down
2 changes: 1 addition & 1 deletion R/f_num.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param digits The number of digits to use. Defaults to 1. Can be set
#' globally via: \code{options(numformdigits = n)} where n is the number of
#' digits beyond the decimal point to include.
#' @param p A string to paste at the begining of the output from \code{f_num}.
#' @param p A string to paste at the beginning of the output from \code{f_num}.
#' @param s A string to paste at the end of the output from \code{f_num}.
#' @param pad.char A character to use for leading padding if lengths of output
#' are unequal.
Expand Down
4 changes: 2 additions & 2 deletions R/f_parenthesis.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#' @param sep The separator between the first number and the leading parenthesis.
#' @param x_prefix A constant to place before each value in the x vector.
#' @param y_prefix A constant to place before each value in the y
#' vector inside of the prenthesis.
#' vector inside of the parenthesis.
#' @param prop_fun The proportion function to convert the y y vector in
#' \code{f_num_percent}. Default is \code{f_prop2percent}. \code{f_percent} is
#' used for when the values are alrey percentages.
#' used for when the values are already percentages.
#' @param \ldots ignored.
#' @return Returns a vector of parenthesis combined strings using vector x and y.
#' @rdname f_parenthesis
Expand Down
4 changes: 2 additions & 2 deletions R/f_title.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#'
#' @param x A vector of text strings.
#' @param upper A vector of regular expression to convert to upper case that
#' would otherwise be lower cased (this should be targetted at the initial output,
#' would otherwise be lower cased (this should be targeted at the initial output,
#' not the input).
#' @param lower A vector of regular expression to convert to lower case that
#' would otherwise be upper cased (this should be targetted at the initial output,
#' would otherwise be upper cased (this should be targeted at the initial output,
#' not the input).
#' @param \ldots ignored.
#' @return Returns a string vector with characters replaced.
Expand Down
2 changes: 1 addition & 1 deletion R/f_wrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' the max number of lines. This is useful for legend spacing.
#' @param collapse logical. If \code{TRUE} then \code{x} is collapsed via
#' \code{paste(x, collapse = ' ')} before processing. This is useful for
#' muti-line text wraping of longer subtitles.
#' muti-line text wrapping of longer subtitles.
#' @param \ldots Other arguments passed to \code{\link[base]{strwrap}}.
#' @return Returns a string vector with wrapped new line characters.
#' @rdname f_wrap
Expand Down
2 changes: 1 addition & 1 deletion R/fv_num_percent.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param x_digits The number of digits to round the x vector.
#' @param y_digits The number of digits to round the y vector.
#' @param sep The separator between the first number and the leading parenthesis.
#' @param comma logiccal. If \code{TRUE} the leading number is comma separated.
#' @param comma logical. If \code{TRUE} the leading number is comma separated.
#' @param \ldots ignored.
#' @rdname fv_num_percent
#' @return Returns a vector of parenthesis combined strings using vector x
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ arguments but returns a function instead. This is useful for passing in
to **ggplot2** `scale_x/y_type` functions (see [Plotting](#plotting) for
usage).

<!-- html table generated in R 3.4.0 by xtable 1.8-2 package -->
<!-- Thu Sep 21 10:11:21 2017 -->
<!-- html table generated in R 3.4.2 by xtable 1.8-2 package -->
<!-- Tue Dec 12 11:05:41 2017 -->
<table>
<tr>
<td>
Expand Down Expand Up @@ -432,12 +432,12 @@ alignment.

<table>
<colgroup>
<col width="9%" />
<col width="6%" />
<col width="10%" />
<col width="5%" />
<col width="10%" />
<col width="6%" />
<col width="6%" />
<col width="12%" />
<col width="11%" />
<col width="8%" />
<col width="9%" />
<col width="15%" />
Expand Down Expand Up @@ -574,11 +574,11 @@ alignment.
data.frame(stringsAsFactors = FALSE, check.names = FALSE) %>%
pander::pander(split.tables = Inf, justify = alignment(.))

<table style="width:62%;">
<table style="width:71%;">
<colgroup>
<col width="23%" />
<col width="19%" />
<col width="19%" />
<col width="26%" />
<col width="22%" />
<col width="22%" />
</colgroup>
<thead>
<tr class="header">
Expand Down Expand Up @@ -696,7 +696,7 @@ Plotting
## 10 406613.1 1999-08-19 Site 3 $487,000 487K $487K A
## # ... with 9,990 more rows, and 1 more variables: abb_week <fctr>

![](tools/figure/unnamed-chunk-21-1.png)
![](tools/figure/unnamed-chunk-14-1.png)

library(tidyverse); library(viridis)

Expand Down Expand Up @@ -754,7 +754,7 @@ Plotting
), width = 85, collapse = TRUE)
)

![](tools/figure/unnamed-chunk-22-1.png)
![](tools/figure/unnamed-chunk-15-1.png)

library(tidyverse); library(gridExtra)

Expand Down Expand Up @@ -828,7 +828,7 @@ Plotting

)

![](tools/figure/unnamed-chunk-23-1.png)
![](tools/figure/unnamed-chunk-16-1.png)

set.seed(10)
dat <- data_frame(
Expand Down Expand Up @@ -857,7 +857,7 @@ Plotting
subtitle = 'Subtitles: For that extra professional look.'
)

![](tools/figure/unnamed-chunk-24-1.png)
![](tools/figure/unnamed-chunk-17-1.png)

library(tidyverse); library(viridis)

Expand Down Expand Up @@ -891,7 +891,7 @@ Plotting
panel.grid.major.x = element_blank()
)

![](tools/figure/unnamed-chunk-25-1.png)
![](tools/figure/unnamed-chunk-18-1.png)

library(tidyverse); library(maps)

Expand All @@ -902,7 +902,7 @@ Plotting
scale_y_continuous(labels = f_latitude) +
scale_x_continuous(labels = f_longitude)

![](tools/figure/unnamed-chunk-26-1.png)
![](tools/figure/unnamed-chunk-19-1.png)

Modeling
--------
Expand Down
2 changes: 1 addition & 1 deletion man/alignment.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/as_factor.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/f_12_hour.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/f_comma.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/f_date.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/f_num.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/f_parenthesis.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/f_title.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/f_wrap.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/fv_num_percent.Rd

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

Binary file modified tools/figure/unnamed-chunk-14-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/figure/unnamed-chunk-15-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/figure/unnamed-chunk-16-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 added tools/figure/unnamed-chunk-17-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 added tools/figure/unnamed-chunk-18-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 added tools/figure/unnamed-chunk-19-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 added tools/figure/unnamed-chunk-37-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 added tools/figure/unnamed-chunk-38-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 added tools/figure/unnamed-chunk-39-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 added tools/figure/unnamed-chunk-40-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 added tools/figure/unnamed-chunk-41-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 added tools/figure/unnamed-chunk-42-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a83390

Please sign in to comment.