Skip to content

Commit

Permalink
Fixes for CRAN check
Browse files Browse the repository at this point in the history
  • Loading branch information
gdemin committed Jul 6, 2020
1 parent fdce45d commit ace3da8
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 70 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
\.gitignore
\.git
^SupplementaryMaterials
\.SupplementaryMaterials
README.MD
tests/testthat/data_files
tests/testthat/test_write_labels.R
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ doc
.RData
data_files
SupplementaryMaterials
.SupplementaryMaterials
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: expss
Type: Package
Title: Tables, Labels and Some Useful Functions from Spreadsheets and 'SPSS' Statistics
Version: 0.10.4
Version: 0.10.5
Maintainer: Gregory Demin <[email protected]>
Authors@R: c(
person("Gregory", "Demin", email = "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.10.4 (05.07.2020)
0.10.5 (05.07.2020)
================
* add argument 'default' for 'var_lab' function (issue #60). Thanks to Dan Chaltiel
* fixes for new versions of R, htmlTable, huxtable
Expand Down
7 changes: 4 additions & 3 deletions R/add_rows.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#' Add rows to data.frame/matrix/table
#'
#' \code{add_rows} is similar to \link[base]{rbind} but it handles non-matching
#' column names. \code{\%add_rows\%} is an infix version of \code{add_rows}.
#' Take a sequence of vector, matrix or data-frame arguments and combine by
#' rows. Contrary to \link[base:cbind]{rbind} it handles non-matching column
#' names. \code{\%add_rows\%} is an infix version of \code{add_rows}.
#' There is also special method for the results of
#' \link{cro}/\link{cro_fun}/\link{tables}/\link{fre}. \code{.add_rows} is
#' version for adding rows to default dataset. See \link{default_dataset}.
Expand All @@ -14,7 +15,7 @@
#' \code{"add"} will combine all columns, \code{"drop"} will leave only common
#' columns, \code{"stop"} will raise an error.
#'
#' @return See \link[base]{rbind}, \link{cro}, \link{cro_fun}, \link{fre}, \link{tables}
#' @return See \link[base:cbind]{rbind}, \link{cro}, \link{cro_fun}, \link{fre}, \link{tables}
#' @export
#'
#' @examples
Expand Down
22 changes: 9 additions & 13 deletions R/compute.R
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
#' Modify data.frame/modify subset of the data.frame
#'
#' \itemize{
#' \item{{\code{compute}}{ evaluates expression \code{expr} in the context of data.frame
#' \code{data} and return original data possibly modified. It works similar to
#' \code{\link[base]{within}} in base R but try to return new variables in order
#' of their occurrence in the expression and make available
#' full-featured \code{\%to\%} and \code{.N} in the expressions. See \link{vars}.}}
#' \item{{\code{calculate}}{ evaluates expression \code{expr} in the context of
#' data.frame \code{data} and return value of the evaluated expression. It works
#' similar to \code{\link[base]{with}} in base R but make available
#' full-featured \code{\%to\%} and \code{.N} in the expressions. See
#' \link{vars}. Function \code{use_labels} is shortcut for \code{calculate} with
#' \item{\code{compute}}{ evaluates expression \code{expr} in the context of data.frame
#' \code{data} and return original data possibly modified.}
#' \item{\code{calculate}}{ evaluates expression \code{expr} in the context of
#' data.frame \code{data} and return value of the evaluated expression. Function \code{use_labels} is shortcut for \code{calculate} with
#' argument \code{use_labels} set to \code{TRUE}. When \code{use_labels} is TRUE
#' there is a special shortcut for entire data.frame - \code{..data}.}}
#' \item{{\code{do_if}}{ modifies only rows for which \code{cond} equals to
#' there is a special shortcut for entire data.frame - \code{..data}.}
#' \item{\code{do_if}}{ modifies only rows for which \code{cond} equals to
#' TRUE. Other rows remain unchanged. Newly created variables also will have
#' values only in rows for which \code{cond} have TRUE. There will be NA's in
#' other rows. This function tries to mimic SPSS "DO IF(). ... END IF."
#' statement.}}
#' statement.}
#' }
#' Full-featured \code{\%to\%} is available in the expressions for addressing
#' range of variables.
#' There is a special constant \code{.N} which equals to number of cases in
#' \code{data} for usage in expression inside \code{compute}/\code{calculate}.
#' Inside \code{do_if} \code{.N} gives number of rows which will be affected by
Expand Down
14 changes: 7 additions & 7 deletions R/criteria_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#' equals to maximum or minimum.}
#' \item{\code{'contains'}}{ searches for the pattern in the strings. By default,
#' it works with fixed patterns rather than regular expressions. For details
#' about its arguments see \link[base]{grepl}}
#' about its arguments see \link[base:grep]{grepl}}
#' \item{\code{'like'}}{ searches for the Excel-style pattern in the strings. You
#' can use wildcards: '*' means any number of symbols, '?' means single symbol.
#' Case insensitive.}
#' \item{\code{'fixed'}}{ alias for contains.}
#' \item{\code{'perl'}}{ such as \code{'contains'} but the pattern is perl-compatible
#' regular expression (\code{'perl = TRUE'}). For details see \link[base]{grepl}}
#' regular expression (\code{'perl = TRUE'}). For details see \link[base:grep]{grepl}}
#' \item{\code{'regex'}}{ use POSIX 1003.2 extended regular expressions
#' (\code{'fixed = FALSE'}). For details see \link[base]{grepl}}
#' (\code{'fixed = FALSE'}). For details see \link[base:grep]{grepl}}
#' \item{\code{'has_label'}}{ searches values which have supplied label(-s). We
#' can used criteria as an argument for 'has_label'.}
#' \item{\code{'to'}}{ returns function which gives TRUE for all elements of
Expand Down Expand Up @@ -56,10 +56,10 @@
#' @param pattern character string containing a regular expression (or character
#' string for \code{'fixed'}) to be matched in the given character vector.
#' Coerced by as.character to a character string if possible.
#' @param perl logical see \link[base]{grepl}
#' @param fixed logical see \link[base]{grepl}
#' @param ignore.case logical see \link[base]{grepl}
#' @param useBytes logical see \link[base]{grepl}
#' @param perl logical see \link[base:grep]{grepl}
#' @param fixed logical see \link[base:grep]{grepl}
#' @param ignore.case logical see \link[base:grep]{grepl}
#' @param useBytes logical see \link[base:grep]{grepl}
#' @param ... numeric indexes of desired items for items, logical vectors or criteria for boolean functions.
#' @param crit vector of values/function which returns logical or vector. It will be
#' converted to function of class criterion.
Expand Down
2 changes: 1 addition & 1 deletion R/custom_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SIGNIFICANCE_OPTIONS = "significance_options"
#' Functions for custom tables construction
#'
#' Table construction consists of at least of three functions chained with
#' \code{magrittr} pipe operator: \link[magrittr]{\%>\%}. At first we need to
#' \code{magrittr} pipe operator. At first we need to
#' specify variables for which statistics will be computed with
#' \code{tab_cells}. Secondary, we calculate statistics with one of
#' \code{tab_stat_*} functions. And last, we finalize table creation with
Expand Down
12 changes: 6 additions & 6 deletions R/fctr.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ LABELS_SEP = "|"
#'
#' \code{fctr} converts variable to factor. It force labels usage as factor
#' labels for labelled variables even if 'expss.enable_value_labels_support' set
#' to 0. For other types of variables base \link[base]{factor} is called. Factor
#' to 0. For other types of variables base \link[base:factor]{factor} is called. Factor
#' levels are constructed as values labels. If label doesn't exist for
#' particular value then this value remain as is - so there is no information
#' lost. This levels look like as "Variable_label|Value label" if argument
#' \code{prepend} set to TRUE.
#'
#' @param x a vector of data with labels.
#' @param ... optional arguments for \code{\link[base]{factor}}
#' @param ... optional arguments for \code{\link[base:factor]{factor}}
#' @param drop_unused_labels logical. Should we drop unused value labels?
#' Default is FALSE.
#' @param prepend_var_lab logical. Should we prepend variable label before value
#' labels? Default is TRUE.
#' @return an object of class factor. For details see base \link[base]{factor} documentation.
#' @return an object of class factor. For details see base \link[base:factor]{factor} documentation.
#'
#' @seealso \link{values2labels}, \link{names2labels}, \link{val_lab},
#' \link{var_lab}. Materials for base functions: \code{\link[base]{factor}},
#' \code{\link[base]{as.factor}}, \code{\link[base]{ordered}},
#' \code{\link[base]{as.ordered}}
#' \link{var_lab}. Materials for base functions: \code{\link[base:factor]{factor}},
#' \code{\link[base:factor]{as.factor}}, \code{\link[base:factor]{ordered}},
#' \code{\link[base:factor]{as.ordered}}
#' @export
#' @examples
#' data(mtcars)
Expand Down
4 changes: 1 addition & 3 deletions R/selectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
#' \item{\code{\%to\%}}{ returns range of variables between \code{e1} and
#' \code{e2} (similar to SPSS 'to'). \link{modify}, \link{modify_if},
#' \link{calculate}, \link{keep}, \link{except} and \link{where} support
#' \code{\%to\%}. Inside global environment \link[base]{with},
#' \link[base]{within} \code{\%to\%} will take range from names of variables
#' sorted in the alphabetic order.}
#' \code{\%to\%}.}
#' \item{\code{indirect}/\code{indirect_list}}{ are aliases for
#' \code{vars}/\code{vars_list}.}
#' }
Expand Down
3 changes: 2 additions & 1 deletion R/write_labelled.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#' @param fileEncoding character string: if non-empty declares the encoding to
#' be used on a file (not a connection) so the character data can be
#' re-encoded as they are written. Used for writing dictionary. See
#' \link[base]{file}.
#' \link[base:connections]{file}.
#'
#' @return Functions for writing invisibly return NULL. Functions for reading
#' return labelled data.frame.
Expand Down Expand Up @@ -838,6 +838,7 @@ old_write_labelled_csv = function(x,
fileEncoding = "",
remove_new_lines = TRUE,
...){
.Deprecated("write_labelled_csv")
if(remove_new_lines){
for(each in seq_along(x)){
if (is.factor(x[[each]])){
Expand Down
7 changes: 4 additions & 3 deletions man/add_rows.Rd

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

22 changes: 9 additions & 13 deletions man/compute.Rd

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

14 changes: 7 additions & 7 deletions man/criteria.Rd

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

12 changes: 6 additions & 6 deletions man/fctr.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/tables.Rd

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

4 changes: 1 addition & 3 deletions man/vars.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/write_labelled_csv.Rd

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

0 comments on commit ace3da8

Please sign in to comment.