From d6425d6423651b285d998a41021a9bb8d74b9b52 Mon Sep 17 00:00:00 2001 From: Simon Garnier Date: Fri, 18 Jan 2019 14:30:44 -0500 Subject: [PATCH] Hides reclass. --- NAMESPACE | 2 - R/dplyr.R | 35 +++---- R/misc.R | 1 - R/nn.R | 3 - docs/reference/dot-reclass.html | 162 +++++++++++++++++++++++++++++ docs/reference/index.html | 12 +-- man/{reclass.Rd => dot-reclass.Rd} | 6 +- 7 files changed, 187 insertions(+), 34 deletions(-) create mode 100644 docs/reference/dot-reclass.html rename man/{reclass.Rd => dot-reclass.Rd} (89%) diff --git a/NAMESPACE b/NAMESPACE index bd590e3..d72b315 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,6 @@ # Generated by roxygen2: do not edit by hand S3method(print,trackTable) -S3method(reclass,default) export(angAcc) export(angSpeed) export(arrange.trackTable) @@ -35,7 +34,6 @@ export(nnd) export(nsd) export(pdist) export(polOrder) -export(reclass) export(rename.trackTable) export(rotOrder) export(sample_frac.trackTable) diff --git a/R/dplyr.R b/R/dplyr.R index 83538fa..d64bdc7 100644 --- a/R/dplyr.R +++ b/R/dplyr.R @@ -8,14 +8,11 @@ #' @param result The modified object, which is / might be missing the class/attributes. #' #' @return \code{result}, now with class/attributes restored. -#' -#' @export -reclass <- function(x, result) { - UseMethod('reclass') +.reclass <- function(x, result) { + UseMethod('.reclass') } -#' @export -reclass.default <- function(x, result) { +.reclass.default <- function(x, result) { class(result) <- unique(c(class(x)[[1]], class(result))) attr(result, class(x)[[1]]) <- attr(x, class(x)[[1]]) result @@ -42,64 +39,64 @@ reclass.default <- function(x, result) { #' @rdname dplyr #' #' @export -select.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +select.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -rename.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +rename.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -filter.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +filter.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -arrange.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +arrange.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -mutate.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +mutate.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -transmute.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +transmute.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -summarise.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +summarise.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -summarize.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +summarize.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -group_by.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +group_by.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -ungroup.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +ungroup.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -sample_n.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +sample_n.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -sample_frac.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +sample_frac.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) #' @rdname dplyr #' #' @export -do.trackTable <- function(.data, ...) reclass(.data, NextMethod()) +do.trackTable <- function(.data, ...) .reclass(.data, NextMethod()) diff --git a/R/misc.R b/R/misc.R index 707d34e..f4a3d58 100644 --- a/R/misc.R +++ b/R/misc.R @@ -111,4 +111,3 @@ list(xC = tmp$center[1], yC = tmp$center[2], alpha = alpha, a = a, b = b) } - diff --git a/R/nn.R b/R/nn.R index 0936343..5217e0e 100644 --- a/R/nn.R +++ b/R/nn.R @@ -136,6 +136,3 @@ nnd <- function(x, y, geo = FALSE) { } }) } - - - diff --git a/docs/reference/dot-reclass.html b/docs/reference/dot-reclass.html new file mode 100644 index 0000000..1319559 --- /dev/null +++ b/docs/reference/dot-reclass.html @@ -0,0 +1,162 @@ + + + + + + + + +Maintain Class After Modification — .reclass • swaRm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
+ +

Copy class and attributes from the original version of an object + to a modified version.

+ +
+ +
.reclass(x, result)
+ +

Arguments

+ + + + + + + + + + +
x

The original object, which has a class/attributes to copy

result

The modified object, which is / might be missing the class/attributes.

+ +

Value

+ +

result, now with class/attributes restored.

+ + +
+ +
+ + +
+ + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html index a3b8c6f..e87f94e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -170,6 +170,12 @@

.reclass()

+ +

Maintain Class After Modification

+ +

.updateError()

@@ -314,12 +320,6 @@

reclass()

- -

Maintain Class After Modification

- -

rotOrder()

diff --git a/man/reclass.Rd b/man/dot-reclass.Rd similarity index 89% rename from man/reclass.Rd rename to man/dot-reclass.Rd index d998a00..2efa71f 100644 --- a/man/reclass.Rd +++ b/man/dot-reclass.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/dplyr.R -\name{reclass} -\alias{reclass} +\name{.reclass} +\alias{.reclass} \title{Maintain Class After Modification} \usage{ -reclass(x, result) +.reclass(x, result) } \arguments{ \item{x}{The original object, which has a class/attributes to copy}