Skip to content

Commit

Permalink
spaces before parens
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Müller committed Apr 8, 2015
1 parent 390f58d commit 9d32f32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions R/each.r
Expand Up @@ -48,7 +48,7 @@ each <- function(...) {
# If there is only one function, things are simple. We just
# need to name the output, if appropriate.
function(x, ...) {
res <- fs[[1]](x, ...)
res <- fs[[1]](x, ...) # nolint
if (length(res) == 1) names(res) <- unames
res
}
Expand All @@ -65,10 +65,10 @@ each <- function(...) {
result <<- vector("list", length = n)
names(result) <- unames

for (i in 1:n) result[[i]] <- fs[[i]](x, ...)
for (i in 1:n) result[[i]] <- fs[[i]](x, ...) # nolint
proto <<- list_to_vector(result)
} else {
for (i in 1:n) proto[[i]] <- fs[[i]](x, ...)
for (i in 1:n) proto[[i]] <- fs[[i]](x, ...) # nolint
}
proto
}
Expand Down
2 changes: 1 addition & 1 deletion R/here.r
Expand Up @@ -21,7 +21,7 @@
#' f2("name:")
#' # Works :)
here <- function(f) {
call <- substitute(function(...) (f)(...), list(f = f))
call <- substitute(function(...) (f)(...), list(f = f)) # nolint
fun <- eval(call, parent.frame())
attr(fun, "srcref") <- srcfilecopy("<text>", deparse(call))
fun
Expand Down
2 changes: 1 addition & 1 deletion R/rbind-fill.r
Expand Up @@ -67,7 +67,7 @@ rbind.fill <- function(...) {
df <- dfs[[i]]

for (var in names(df)) {
setters[[var]](rng, df[[var]])
setters[[var]](rng, df[[var]]) # nolint
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-rbind.r
Expand Up @@ -286,19 +286,19 @@ expect_linear_enough <- function(timings, size=2^10, threshold=0.2) {
}

test_that("rbind.fill performance linear", {
timings <- get_rbind_times(data.frame(size = 2^(1:10)),
timings <- get_rbind_times(data.frame(size = 2 ^ (1:10)),
classes=c("numeric", "character", "array"))
expect_linear_enough(timings)
})

test_that("rbind.fill performance linear with factors", {
timings <- get_rbind_times(data.frame(size = 2^(1:10)),
timings <- get_rbind_times(data.frame(size = 2 ^ (1:10)),
classes=c("factor"))
expect_linear_enough(timings)
})

test_that("rbind.fill performance linear with times", {
timings <- get_rbind_times(data.frame(size = 2^(1:10)),
timings <- get_rbind_times(data.frame(size = 2 ^ (1:10)),
classes=c("time"))
expect_linear_enough(timings)
})
Expand Down

0 comments on commit 9d32f32

Please sign in to comment.