Skip to content

Commit

Permalink
Final fixes for R CMD check
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Oct 12, 2012
1 parent 20b9d7b commit ac9fc5d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1,3 @@
benchmark benchmark
src/.gitignore src/.gitignore
man-roxygen
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ S3method(names,quoted)
S3method(print,indexed) S3method(print,indexed)
S3method(print,quoted) S3method(print,quoted)
S3method(print,split) S3method(print,split)
S3method(round_any,POSIXct)
S3method(round_any,numeric)
export(.) export(.)
export(a_ply) export(a_ply)
export(aaply) export(aaply)
Expand Down
2 changes: 2 additions & 0 deletions R/indexed-data-frame.r
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ indexed_df <- function(data, index, vars) {
} }


extract_rows <- function(x, i) { extract_rows <- function(x, i) {
if (!is.data.frame(x)) return(x[i, , drop = FALSE])

n <- ncol(x) n <- ncol(x)


out <- lapply(seq_len(n), extract_col_rows, df = x, i = i) out <- lapply(seq_len(n), extract_col_rows, df = x, i = i)
Expand Down
2 changes: 2 additions & 0 deletions R/round-any.r
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ round_any <- function(x, accuracy, f = round) {
UseMethod("round_any") UseMethod("round_any")
} }


#' @S3method round_any numeric
round_any.numeric <- function(x, accuracy, f = round) { round_any.numeric <- function(x, accuracy, f = round) {
f(x / accuracy) * accuracy f(x / accuracy) * accuracy
} }


#' @S3method round_any POSIXct
round_any.POSIXct <- function(x, accuracy, f = round) { round_any.POSIXct <- function(x, accuracy, f = round) {
tz <- format(x[1], "%Z") tz <- format(x[1], "%Z")
xr <- round_any(as.numeric(x), accuracy, f) xr <- round_any(as.numeric(x), accuracy, f)
Expand Down

0 comments on commit ac9fc5d

Please sign in to comment.