Skip to content

Commit

Permalink
Fixes after package check
Browse files Browse the repository at this point in the history
  • Loading branch information
gdemin committed Jan 6, 2022
1 parent b9ec57f commit 5a44e8b
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 26 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ export(repr_html.with_caption)
export(repr_text.etable)
export(repr_text.with_caption)
}
import(foreign)
import(htmlTable)
import(maditr)
import(matrixStats)
Expand Down
14 changes: 11 additions & 3 deletions R/add_columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#' by different variables on \code{x} and \code{y} use a named vector.
#' For example, \code{by = c("a" = "b")} will match x.a to y.b.
#' @param ignore_duplicates logical Should we ignore duplicates in the \code{by}
#' variables in the \code{y}? If it is TRUE than first occurence of duplicated
#' variables in the \code{y}? If it is TRUE than first occurrence of duplicated
#' key will be used.
#' @param ... arguments for further methods
#' @return data.frame
#'
#' @export
Expand Down Expand Up @@ -44,16 +45,23 @@
#' @export
add_columns = function(x, y,
by = NULL,
ignore_duplicates = FALSE
ignore_duplicates = FALSE,
...
){
UseMethod("add_columns")

}

#' @export
add_columns.etable = function(x, y, by = 1, ignore_duplicates = FALSE, ...){
merge(x, y, by = by, ...)
}

#' @export
add_columns.data.frame = function(x, y,
by = NULL,
ignore_duplicates = FALSE
ignore_duplicates = FALSE,
...
){
if(!is.data.frame(x)) x = as.sheet(x)
if(!is.data.frame(y)) y = as.sheet(y)
Expand Down
2 changes: 0 additions & 2 deletions R/add_rows.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#' \link{cro}/\link{cro_fun}/\link{tables}/\link{fre}.
#'
#' @param ... data.frame/matrix/table for binding
#' @param x data.frame/matrix/table for binding
#' @param y data.frame/matrix/table for binding
#' @param nomatch_columns action if there are non-matching columns between
#' data.frames. Possible values are \code{"add"}, \code{"drop"}, \code{"stop"}.
#' \code{"add"} will combine all columns, \code{"drop"} will leave only common
Expand Down
2 changes: 1 addition & 1 deletion R/expss.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NULL

#' @import maditr
#' @import htmlTable
#' @import foreign stats utils matrixStats
#' @import stats utils matrixStats
#' @importFrom data.table data.table

data.table = maditr::data.table
Expand Down
6 changes: 4 additions & 2 deletions R/html_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
#'
#' # several tables in a list
#' list(
#' cross_cpct(mtcars, list(am, vs, cyl), list(total(), am)) %>% set_caption("Table 1. Percent."),
#' cross_mean_sd_n(mtcars, list(mpg, hp, qsec), list(total(), am)) %>% set_caption("Table 2. Means.")
#' cross_cpct(mtcars, list(am, vs, cyl), list(total(), am))
#' %>% set_caption("Table 1. Percent."),
#' cross_mean_sd_n(mtcars, list(mpg, hp, qsec), list(total(), am))
#' %>% set_caption("Table 2. Means.")
#' ) %>%
#' htmlTable()
#'
Expand Down
14 changes: 10 additions & 4 deletions R/merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
#'
#' @param x data.frame or results of \code{fre}/\code{cross_*}/\code{table_*}
#' @param y data.frame or results of \code{fre}/\code{cross_*}/\code{table_*}
#'
#' @param by for 'etable' object default is 1 (first column). For details see \link[base]{merge}
#' @param by.x For details see \link[base]{merge}
#' @param by.y For details see \link[base]{merge}
#' @param all For details see \link[base]{merge}
#' @param all.x For details see \link[base]{merge}
#' @param all.y For details see \link[base]{merge}
#' @param sort For details see \link[base]{merge}
#' @param suffixes For details see \link[base]{merge}
#' @param incomparables For details see \link[base]{merge}
#' @param ... arguments to be passed to or from methods.
#' @return data.frame
#' @name merge.etable
#' @export
Expand Down Expand Up @@ -80,9 +89,6 @@ merge.etable = function(x, y,
}


#' @export
add_columns.etable = merge.etable



merge_table = function(x, y,
Expand Down
4 changes: 2 additions & 2 deletions R/split_by.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
#' ")
#' ) %>%
#' split_by(am, vs) %>%
#' use_labels({
#' res = lm(mpg ~ hp + disp + wt)
#' to_list({
#' res = lm(mpg ~ hp + disp + wt, data = .x)
#' cbind(Coef. = coef(res), confint(res))
#' }) %>%
#' split_off(groups = TRUE, rownames = "variable")
Expand Down
6 changes: 4 additions & 2 deletions man/add_columns.Rd

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

4 changes: 0 additions & 4 deletions man/add_rows.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/compare_proportions.Rd

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

6 changes: 4 additions & 2 deletions man/htmlTable.etable.Rd

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

20 changes: 20 additions & 0 deletions man/merge.etable.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/split_by.Rd

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

0 comments on commit 5a44e8b

Please sign in to comment.