zachmayer / caretEnsemble

caret models all the way down :turtle:
Other
226 stars 75 forks source link

Refactor caretEnsemble #185

Closed zachmayer closed 8 years ago

zachmayer commented 8 years ago

Make caretEnsemble inherit from caretStack. This make maintenance much easier as it removes all the optimizers, which were getting unwieldy. Replaced them with a glm, which typically gives the same model weights, with the important caveat that weights can be negative. This doesn't bother me, but if desired we could use a non-negative regression package.

Also fixed a lot of broken tests and things that broke due to a new caret version. caretEnsemble should be usable again!

zachmayer commented 8 years ago

So on one build lintr failed: https://travis-ci.org/zachmayer/caretEnsemble/jobs/106112153

And the other build has 3 warnings I'll work on fixing: https://travis-ci.org/zachmayer/caretEnsemble/jobs/106112154

  1. I dunno how to fix this one. I guess it's a ggplot2 issue?
checking whether package ‘caretEnsemble’ can be installed ... WARNING
Found the following significant warnings:
  Warning: replacing previous import by ‘grid::arrow’ when loading ‘caretEnsemble’
  Warning: replacing previous import by ‘grid::unit’ when loading ‘caretEnsemble’
  1. Silly error, I can fix
checking S3 generic/method consistency ... WARNING
getMetric:
  function(x, metric, ...)
getMetric.train:
  function(x, metric)
getMetricSD:
  function(x, metric, ...)
getMetricSD.train:
  function(x, metric)
  1. Silly error, I can fix
checking Rd \usage sections ... WARNING
Duplicated \argument entries in documentation object 'getMetric':
  ‘x’ ‘metric’ ‘...’
Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
jknowles commented 8 years ago

I thinks we can fix the first by finding out where @importFrom grid arrow is called and eliminating it. It means somewhere we import grid as a package and somewhere else we import just the function and it is duplicated.

zachmayer commented 8 years ago

@jknowles Gotcha. I'll try it out.

What do you think of the refactor of caretEnsemble to be a sub-class of caretStack? I like how much it simplifies the code, and all the S3 methods still work.

I actually think we can port all the S3 methods over to caretStack too.

The downside is we lose the optimizers, but those were a headache to maintain anyways. I think we could make a new package for greedy, forward, non-negative regression/classification, and then add it to the caret package.

That way the optimizers could have their own package, test-suite, issue tracker, etc.

zachmayer commented 8 years ago

Ok tests pass locally when NOT_CRAN="false" and NOT_CRAN="true", with no warnings, errors, or notes.

I still get this message though, even though I replaced ALL imports with importFrom. Weird:

Note: the specification for S3 class “family” in package ‘MatrixModels’ seems equivalent to one from package ‘lme4’: not turning on duplicate class definitions for this class.
Warning: replacing previous import by ‘grid::arrow’ when loading ‘caretEnsemble’
Warning: replacing previous import by ‘grid::unit’ when loading ‘caretEnsemble’

Anyways, at this point I'm going to run devtools::build_win() and if that passes ship it to CRAN.

zachmayer commented 8 years ago

devtools::build_win() passes with 2 NOTES. I'm writing the warnings off as travis peculiarities.

zachmayer commented 8 years ago

Running build_win() again with the new imports from base R

zachmayer commented 8 years ago

Ok, on this commit, build_win() runs without errors, warnings, or notes. I also get no errors, warnings, or notes in my local tests.

lintr-bot commented 8 years ago

inst/doc/caretEnsemble-intro.R:14:28: style: Commas should always have a space after.

​training <- Sonar[ inTrain,]
                           ^

inst/doc/caretEnsemble-intro.R:15:27: style: Commas should always have a space after.

​testing <- Sonar[-inTrain,]
                          ^

inst/doc/caretEnsemble-intro.R:70:14: style: Trailing whitespace is superfluous.

​  model_list, 
             ^

inst/doc/caretEnsemble-intro.R:82:51: style: Commas should always have a space after.

​model_preds <- lapply(model_preds, function(x) x[,"M"])
                                                  ^

inst/doc/caretEnsemble-intro.R:136:1: style: Trailing blank lines are superfluous.

​
^

R/caretEnsemble.R:145:76: style: Commas should always have a space after.

​    tmp.t <- out[attributes(out)$dimnames[[nams[[i]]]] == as.character(bt[,nams[i]])]
                                                                           ^

R/caretEnsemble.R:192:38: style: Commas should always have a space after.

​  dat <- dat[order(dat[["overall"]]),]
                                     ^

R/caretEnsemble.R:200:33: style: Commas should always have a space after.

​  x$importance <- x$importance[,"Overall", drop=FALSE]
                                ^

R/caretEnsemble.R:213:36: style: Commas should always have a space after.

​  dat$model <- sub("\\.[^\n]*", "",dat$id)
                                   ^

R/caretEnsemble.R:223:26: style: Commas should always have a space after.

​  row.names(dat) <- dat[,1]
                         ^

R/caretEnsemble.R:224:15: style: Commas should always have a space after.

​  return(dat[,-1])
              ^

R/caretList.R:268:69: style: Commas should always have a space after.

​        caret::predict.train(x, type="prob", newdata=newdata, ...)[,2]
                                                                    ^

R/helper_functions.R:15:30: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                             ^

R/helper_functions.R:15:32: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                               ^

R/helper_functions.R:63:78: style: Commas should always have a space after.

​    probModels <- sapply(list_of_models, function(x) modelLookup(x$method)[1,"probModel"])
                                                                             ^

R/helper_functions.R:177:12: style: Commas should always have a space after.

​  b <- b[a,]
           ^

R/helper_functions.R:245:87: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                      ^

R/helper_functions.R:245:96: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                               ^

R/helper_functions.R:256:67: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                  ^

R/helper_functions.R:256:79: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                              ^

tests/testthat/test-caretList.R:62:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                        ^

tests/testthat/test-caretList.R:62:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                    ^

tests/testthat/test-caretList.R:62:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                               ^

tests/testthat/test-caretList.R:63:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                        ^

tests/testthat/test-caretList.R:63:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                    ^

tests/testthat/test-caretList.R:63:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                               ^

tests/testthat/test-caretList.R:64:61: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Species ~ ., iris), iris[,"Species"])
                                                            ^

tests/testthat/test-caretList.R:65:65: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Sepal.Width ~ ., iris), iris[,"Sepal.Width"])
                                                                ^

tests/testthat/test-caretList.R:86:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:86:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:87:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:87:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:88:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                   ^

tests/testthat/test-caretList.R:88:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                               ^

tests/testthat/test-caretList.R:89:33: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                ^

tests/testthat/test-caretList.R:89:45: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                            ^

tests/testthat/test-caretList.R:100:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:100:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:113:17: style: Commas should always have a space after.

​  expect_is(p1[,1], "character")
                ^

tests/testthat/test-caretList.R:114:17: style: Commas should always have a space after.

​  expect_is(p1[,2], "character")
                ^

tests/testthat/test-caretList.R:117:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "character")
                ^

tests/testthat/test-caretList.R:118:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "character")
                ^

tests/testthat/test-caretList.R:121:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "character")
                ^

tests/testthat/test-caretList.R:122:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "character")
                ^

tests/testthat/test-caretList.R:127:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:127:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:136:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "numeric")
                ^

tests/testthat/test-caretList.R:137:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "numeric")
                ^

tests/testthat/test-caretList.R:139:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "numeric")
                ^

tests/testthat/test-caretList.R:140:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "numeric")
                ^

tests/testthat/test-caretList.R:160:17: style: Commas should always have a space after.

​      x = iris[,1:3],
                ^

tests/testthat/test-caretList.R:161:17: style: Commas should always have a space after.

​      y = iris[,4],
                ^

tests/testthat/test-caretList.R:205:23: style: Commas should always have a space after.

​            x = iris[,1:3],
                      ^

tests/testthat/test-caretList.R:206:23: style: Commas should always have a space after.

​            y = iris[,4],
                      ^

tests/testthat/test-caretList.R:332:18: style: Commas should never have a space before.

​      y = train[ , "Class"],
                ~^

tests/testthat/test-caretList.R:448:37: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                    ^

tests/testthat/test-caretList.R:448:42: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                         ^

tests/testthat/test-caretList.R:448:45: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                            ^

tests/testthat/test-caretList.R:519:14: style: Commas should always have a space after.

​  x <- iris[,1:3]
             ^

tests/testthat/test-caretList.R:520:14: style: Commas should always have a space after.

​  y <- iris[,4]
             ^

tests/testthat/test-ensembleMethods.R:200:40: style: Commas should always have a space after.

​  mr1 <- mr1[order(mr1$method, mr1$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:201:40: style: Commas should always have a space after.

​  mr2 <- mr2[order(mr2$method, mr2$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:220:70: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                     ^

tests/testthat/test-ensembleMethods.R:220:110: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                                                             ^

tests/testthat/test-ensembleMethods.R:281:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:282:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"]
                               ^

tests/testthat/test-ensembleMethods.R:286:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:294:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensembleMethods.R:309:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:310:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"],
                               ^

tests/testthat/test-ensembleMethods.R:315:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:323:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensemble.R:28:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:28:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-ensemble.R:56:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:56:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-helper_functions.R:28:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-helper_functions.R:28:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-helper_functions.R:37:13: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
            ^

tests/testthat/test-helper_functions.R:37:39: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                      ^

tests/testthat/test-helper_functions.R:43:11: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
          ^

tests/testthat/test-helper_functions.R:43:37: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                    ^

tests/testthat/test-helper_functions.R:151:93: style: Commas should always have a space after.

​  modelLibrary$nn <- modelLibrary$lm[sample(1:nrow(modelLibrary$lm), nrow(modelLibrary$lm)),]
                                                                                            ^

tests/testthat/test-helper_functions.R:185:18: style: Commas should always have a space after.

​      iris[1:100,-5],
                 ^
lintr-bot commented 8 years ago

inst/doc/caretEnsemble-intro.R:14:28: style: Commas should always have a space after.

​training <- Sonar[ inTrain,]
                           ^

inst/doc/caretEnsemble-intro.R:15:27: style: Commas should always have a space after.

​testing <- Sonar[-inTrain,]
                          ^

inst/doc/caretEnsemble-intro.R:70:14: style: Trailing whitespace is superfluous.

​  model_list, 
             ^

inst/doc/caretEnsemble-intro.R:82:51: style: Commas should always have a space after.

​model_preds <- lapply(model_preds, function(x) x[,"M"])
                                                  ^

inst/doc/caretEnsemble-intro.R:136:1: style: Trailing blank lines are superfluous.

​
^

R/caretEnsemble.R:145:76: style: Commas should always have a space after.

​    tmp.t <- out[attributes(out)$dimnames[[nams[[i]]]] == as.character(bt[,nams[i]])]
                                                                           ^

R/caretEnsemble.R:192:38: style: Commas should always have a space after.

​  dat <- dat[order(dat[["overall"]]),]
                                     ^

R/caretEnsemble.R:200:33: style: Commas should always have a space after.

​  x$importance <- x$importance[,"Overall", drop=FALSE]
                                ^

R/caretEnsemble.R:213:36: style: Commas should always have a space after.

​  dat$model <- sub("\\.[^\n]*", "",dat$id)
                                   ^

R/caretEnsemble.R:223:26: style: Commas should always have a space after.

​  row.names(dat) <- dat[,1]
                         ^

R/caretEnsemble.R:224:15: style: Commas should always have a space after.

​  return(dat[,-1])
              ^

R/caretList.R:268:69: style: Commas should always have a space after.

​        caret::predict.train(x, type="prob", newdata=newdata, ...)[,2]
                                                                    ^

R/helper_functions.R:15:30: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                             ^

R/helper_functions.R:15:32: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                               ^

R/helper_functions.R:63:78: style: Commas should always have a space after.

​    probModels <- sapply(list_of_models, function(x) modelLookup(x$method)[1,"probModel"])
                                                                             ^

R/helper_functions.R:177:12: style: Commas should always have a space after.

​  b <- b[a,]
           ^

R/helper_functions.R:245:87: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                      ^

R/helper_functions.R:245:96: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                               ^

R/helper_functions.R:256:67: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                  ^

R/helper_functions.R:256:79: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                              ^

tests/testthat/test-caretList.R:62:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                        ^

tests/testthat/test-caretList.R:62:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                    ^

tests/testthat/test-caretList.R:62:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                               ^

tests/testthat/test-caretList.R:63:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                        ^

tests/testthat/test-caretList.R:63:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                    ^

tests/testthat/test-caretList.R:63:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                               ^

tests/testthat/test-caretList.R:64:61: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Species ~ ., iris), iris[,"Species"])
                                                            ^

tests/testthat/test-caretList.R:65:65: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Sepal.Width ~ ., iris), iris[,"Sepal.Width"])
                                                                ^

tests/testthat/test-caretList.R:86:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:86:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:87:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:87:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:88:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                   ^

tests/testthat/test-caretList.R:88:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                               ^

tests/testthat/test-caretList.R:89:33: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                ^

tests/testthat/test-caretList.R:89:45: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                            ^

tests/testthat/test-caretList.R:100:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:100:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:113:17: style: Commas should always have a space after.

​  expect_is(p1[,1], "character")
                ^

tests/testthat/test-caretList.R:114:17: style: Commas should always have a space after.

​  expect_is(p1[,2], "character")
                ^

tests/testthat/test-caretList.R:117:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "character")
                ^

tests/testthat/test-caretList.R:118:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "character")
                ^

tests/testthat/test-caretList.R:121:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "character")
                ^

tests/testthat/test-caretList.R:122:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "character")
                ^

tests/testthat/test-caretList.R:127:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:127:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:136:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "numeric")
                ^

tests/testthat/test-caretList.R:137:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "numeric")
                ^

tests/testthat/test-caretList.R:139:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "numeric")
                ^

tests/testthat/test-caretList.R:140:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "numeric")
                ^

tests/testthat/test-caretList.R:160:17: style: Commas should always have a space after.

​      x = iris[,1:3],
                ^

tests/testthat/test-caretList.R:161:17: style: Commas should always have a space after.

​      y = iris[,4],
                ^

tests/testthat/test-caretList.R:205:23: style: Commas should always have a space after.

​            x = iris[,1:3],
                      ^

tests/testthat/test-caretList.R:206:23: style: Commas should always have a space after.

​            y = iris[,4],
                      ^

tests/testthat/test-caretList.R:332:18: style: Commas should never have a space before.

​      y = train[ , "Class"],
                ~^

tests/testthat/test-caretList.R:448:37: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                    ^

tests/testthat/test-caretList.R:448:42: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                         ^

tests/testthat/test-caretList.R:448:45: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                            ^

tests/testthat/test-caretList.R:519:14: style: Commas should always have a space after.

​  x <- iris[,1:3]
             ^

tests/testthat/test-caretList.R:520:14: style: Commas should always have a space after.

​  y <- iris[,4]
             ^

tests/testthat/test-ensembleMethods.R:200:40: style: Commas should always have a space after.

​  mr1 <- mr1[order(mr1$method, mr1$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:201:40: style: Commas should always have a space after.

​  mr2 <- mr2[order(mr2$method, mr2$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:220:70: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                     ^

tests/testthat/test-ensembleMethods.R:220:110: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                                                             ^

tests/testthat/test-ensembleMethods.R:281:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:282:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"]
                               ^

tests/testthat/test-ensembleMethods.R:286:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:294:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensembleMethods.R:309:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:310:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"],
                               ^

tests/testthat/test-ensembleMethods.R:315:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:323:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensemble.R:28:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:28:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-ensemble.R:56:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:56:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-helper_functions.R:28:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-helper_functions.R:28:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-helper_functions.R:37:13: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
            ^

tests/testthat/test-helper_functions.R:37:39: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                      ^

tests/testthat/test-helper_functions.R:43:11: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
          ^

tests/testthat/test-helper_functions.R:43:37: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                    ^

tests/testthat/test-helper_functions.R:151:93: style: Commas should always have a space after.

​  modelLibrary$nn <- modelLibrary$lm[sample(1:nrow(modelLibrary$lm), nrow(modelLibrary$lm)),]
                                                                                            ^

tests/testthat/test-helper_functions.R:185:18: style: Commas should always have a space after.

​      iris[1:100,-5],
                 ^
lintr-bot commented 8 years ago

inst/doc/caretEnsemble-intro.R:14:28: style: Commas should always have a space after.

​training <- Sonar[ inTrain,]
                           ^

inst/doc/caretEnsemble-intro.R:15:27: style: Commas should always have a space after.

​testing <- Sonar[-inTrain,]
                          ^

inst/doc/caretEnsemble-intro.R:70:14: style: Trailing whitespace is superfluous.

​  model_list, 
             ^

inst/doc/caretEnsemble-intro.R:82:51: style: Commas should always have a space after.

​model_preds <- lapply(model_preds, function(x) x[,"M"])
                                                  ^

inst/doc/caretEnsemble-intro.R:136:1: style: Trailing blank lines are superfluous.

​
^

R/caretEnsemble.R:145:76: style: Commas should always have a space after.

​    tmp.t <- out[attributes(out)$dimnames[[nams[[i]]]] == as.character(bt[,nams[i]])]
                                                                           ^

R/caretEnsemble.R:192:38: style: Commas should always have a space after.

​  dat <- dat[order(dat[["overall"]]),]
                                     ^

R/caretEnsemble.R:200:33: style: Commas should always have a space after.

​  x$importance <- x$importance[,"Overall", drop=FALSE]
                                ^

R/caretEnsemble.R:213:36: style: Commas should always have a space after.

​  dat$model <- sub("\\.[^\n]*", "",dat$id)
                                   ^

R/caretEnsemble.R:223:26: style: Commas should always have a space after.

​  row.names(dat) <- dat[,1]
                         ^

R/caretEnsemble.R:224:15: style: Commas should always have a space after.

​  return(dat[,-1])
              ^

R/caretList.R:268:69: style: Commas should always have a space after.

​        caret::predict.train(x, type="prob", newdata=newdata, ...)[,2]
                                                                    ^

R/helper_functions.R:15:30: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                             ^

R/helper_functions.R:15:32: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                               ^

R/helper_functions.R:63:78: style: Commas should always have a space after.

​    probModels <- sapply(list_of_models, function(x) modelLookup(x$method)[1,"probModel"])
                                                                             ^

R/helper_functions.R:177:12: style: Commas should always have a space after.

​  b <- b[a,]
           ^

R/helper_functions.R:245:87: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                      ^

R/helper_functions.R:245:96: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                               ^

R/helper_functions.R:256:67: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                  ^

R/helper_functions.R:256:79: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                              ^

tests/testthat/test-caretList.R:62:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                        ^

tests/testthat/test-caretList.R:62:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                    ^

tests/testthat/test-caretList.R:62:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                               ^

tests/testthat/test-caretList.R:63:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                        ^

tests/testthat/test-caretList.R:63:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                    ^

tests/testthat/test-caretList.R:63:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                               ^

tests/testthat/test-caretList.R:64:61: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Species ~ ., iris), iris[,"Species"])
                                                            ^

tests/testthat/test-caretList.R:65:65: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Sepal.Width ~ ., iris), iris[,"Sepal.Width"])
                                                                ^

tests/testthat/test-caretList.R:86:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:86:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:87:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:87:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:88:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                   ^

tests/testthat/test-caretList.R:88:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                               ^

tests/testthat/test-caretList.R:89:33: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                ^

tests/testthat/test-caretList.R:89:45: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                            ^

tests/testthat/test-caretList.R:100:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:100:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:113:17: style: Commas should always have a space after.

​  expect_is(p1[,1], "character")
                ^

tests/testthat/test-caretList.R:114:17: style: Commas should always have a space after.

​  expect_is(p1[,2], "character")
                ^

tests/testthat/test-caretList.R:117:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "character")
                ^

tests/testthat/test-caretList.R:118:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "character")
                ^

tests/testthat/test-caretList.R:121:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "character")
                ^

tests/testthat/test-caretList.R:122:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "character")
                ^

tests/testthat/test-caretList.R:127:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:127:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:136:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "numeric")
                ^

tests/testthat/test-caretList.R:137:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "numeric")
                ^

tests/testthat/test-caretList.R:139:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "numeric")
                ^

tests/testthat/test-caretList.R:140:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "numeric")
                ^

tests/testthat/test-caretList.R:160:17: style: Commas should always have a space after.

​      x = iris[,1:3],
                ^

tests/testthat/test-caretList.R:161:17: style: Commas should always have a space after.

​      y = iris[,4],
                ^

tests/testthat/test-caretList.R:205:23: style: Commas should always have a space after.

​            x = iris[,1:3],
                      ^

tests/testthat/test-caretList.R:206:23: style: Commas should always have a space after.

​            y = iris[,4],
                      ^

tests/testthat/test-caretList.R:332:18: style: Commas should never have a space before.

​      y = train[ , "Class"],
                ~^

tests/testthat/test-caretList.R:448:37: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                    ^

tests/testthat/test-caretList.R:448:42: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                         ^

tests/testthat/test-caretList.R:448:45: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                            ^

tests/testthat/test-caretList.R:519:14: style: Commas should always have a space after.

​  x <- iris[,1:3]
             ^

tests/testthat/test-caretList.R:520:14: style: Commas should always have a space after.

​  y <- iris[,4]
             ^

tests/testthat/test-ensembleMethods.R:200:40: style: Commas should always have a space after.

​  mr1 <- mr1[order(mr1$method, mr1$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:201:40: style: Commas should always have a space after.

​  mr2 <- mr2[order(mr2$method, mr2$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:220:70: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                     ^

tests/testthat/test-ensembleMethods.R:220:110: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                                                             ^

tests/testthat/test-ensembleMethods.R:281:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:282:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"]
                               ^

tests/testthat/test-ensembleMethods.R:286:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:294:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensembleMethods.R:309:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:310:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"],
                               ^

tests/testthat/test-ensembleMethods.R:315:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:323:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensemble.R:28:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:28:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-ensemble.R:56:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:56:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-helper_functions.R:28:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-helper_functions.R:28:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-helper_functions.R:37:13: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
            ^

tests/testthat/test-helper_functions.R:37:39: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                      ^

tests/testthat/test-helper_functions.R:43:11: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
          ^

tests/testthat/test-helper_functions.R:43:37: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                    ^

tests/testthat/test-helper_functions.R:151:93: style: Commas should always have a space after.

​  modelLibrary$nn <- modelLibrary$lm[sample(1:nrow(modelLibrary$lm), nrow(modelLibrary$lm)),]
                                                                                            ^

tests/testthat/test-helper_functions.R:185:18: style: Commas should always have a space after.

​      iris[1:100,-5],
                 ^
lintr-bot commented 8 years ago

inst/doc/caretEnsemble-intro.R:14:28: style: Commas should always have a space after.

​training <- Sonar[ inTrain,]
                           ^

inst/doc/caretEnsemble-intro.R:15:27: style: Commas should always have a space after.

​testing <- Sonar[-inTrain,]
                          ^

inst/doc/caretEnsemble-intro.R:70:14: style: Trailing whitespace is superfluous.

​  model_list, 
             ^

inst/doc/caretEnsemble-intro.R:82:51: style: Commas should always have a space after.

​model_preds <- lapply(model_preds, function(x) x[,"M"])
                                                  ^

inst/doc/caretEnsemble-intro.R:136:1: style: Trailing blank lines are superfluous.

​
^

R/caretEnsemble.R:145:76: style: Commas should always have a space after.

​    tmp.t <- out[attributes(out)$dimnames[[nams[[i]]]] == as.character(bt[,nams[i]])]
                                                                           ^

R/caretEnsemble.R:192:38: style: Commas should always have a space after.

​  dat <- dat[order(dat[["overall"]]),]
                                     ^

R/caretEnsemble.R:200:33: style: Commas should always have a space after.

​  x$importance <- x$importance[,"Overall", drop=FALSE]
                                ^

R/caretEnsemble.R:213:36: style: Commas should always have a space after.

​  dat$model <- sub("\\.[^\n]*", "",dat$id)
                                   ^

R/caretEnsemble.R:223:26: style: Commas should always have a space after.

​  row.names(dat) <- dat[,1]
                         ^

R/caretEnsemble.R:224:15: style: Commas should always have a space after.

​  return(dat[,-1])
              ^

R/caretList.R:268:69: style: Commas should always have a space after.

​        caret::predict.train(x, type="prob", newdata=newdata, ...)[,2]
                                                                    ^

R/helper_functions.R:15:30: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                             ^

R/helper_functions.R:15:32: style: Commas should always have a space after.

​    xWbar <- weighted.mean(x,w,na.rm=na.rm)
                               ^

R/helper_functions.R:63:78: style: Commas should always have a space after.

​    probModels <- sapply(list_of_models, function(x) modelLookup(x$method)[1,"probModel"])
                                                                             ^

R/helper_functions.R:177:12: style: Commas should always have a space after.

​  b <- b[a,]
           ^

R/helper_functions.R:245:87: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                      ^

R/helper_functions.R:245:96: style: Commas should always have a space after.

​    set(modelLibrary, i=good_pos_values, j="pred", value=modelLibrary[good_pos_values,positive,with=FALSE])
                                                                                               ^

R/helper_functions.R:256:67: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                  ^

R/helper_functions.R:256:79: style: Commas should always have a space after.

​  return(list(obs=modelLibrary$obs, preds=as.matrix(modelLibrary[,model_names,with=FALSE]), type=type))
                                                                              ^

tests/testthat/test-caretList.R:62:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                        ^

tests/testthat/test-caretList.R:62:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                    ^

tests/testthat/test-caretList.R:62:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,1:4], iris[,5]), iris[,5])
                                                               ^

tests/testthat/test-caretList.R:63:41: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                        ^

tests/testthat/test-caretList.R:63:53: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                    ^

tests/testthat/test-caretList.R:63:64: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(iris[,2:5], iris[,1]), iris[,1])
                                                               ^

tests/testthat/test-caretList.R:64:61: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Species ~ ., iris), iris[,"Species"])
                                                            ^

tests/testthat/test-caretList.R:65:65: style: Commas should always have a space after.

​  expect_equal(extractCaretTarget(Sepal.Width ~ ., iris), iris[,"Sepal.Width"])
                                                                ^

tests/testthat/test-caretList.R:86:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:86:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:87:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                   ^

tests/testthat/test-caretList.R:87:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control))
                                               ^

tests/testthat/test-caretList.R:88:36: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                   ^

tests/testthat/test-caretList.R:88:48: style: Commas should always have a space after.

​      expect_error(caretList(iris[,1:4], iris[,5], tuneList=bad_bad, trControl=my_control, continue_on_fail=TRUE))
                                               ^

tests/testthat/test-caretList.R:89:33: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                ^

tests/testthat/test-caretList.R:89:45: style: Commas should always have a space after.

​      expect_is(caretList(iris[,1:4], iris[,5], tuneList=good_bad, trControl=my_control, continue_on_fail=TRUE), "caretList")
                                            ^

tests/testthat/test-caretList.R:100:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:100:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:113:17: style: Commas should always have a space after.

​  expect_is(p1[,1], "character")
                ^

tests/testthat/test-caretList.R:114:17: style: Commas should always have a space after.

​  expect_is(p1[,2], "character")
                ^

tests/testthat/test-caretList.R:117:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "character")
                ^

tests/testthat/test-caretList.R:118:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "character")
                ^

tests/testthat/test-caretList.R:121:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "character")
                ^

tests/testthat/test-caretList.R:122:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "character")
                ^

tests/testthat/test-caretList.R:127:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-caretList.R:127:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-caretList.R:136:17: style: Commas should always have a space after.

​  expect_is(p2[,1], "numeric")
                ^

tests/testthat/test-caretList.R:137:17: style: Commas should always have a space after.

​  expect_is(p2[,2], "numeric")
                ^

tests/testthat/test-caretList.R:139:17: style: Commas should always have a space after.

​  expect_is(p3[,1], "numeric")
                ^

tests/testthat/test-caretList.R:140:17: style: Commas should always have a space after.

​  expect_is(p3[,2], "numeric")
                ^

tests/testthat/test-caretList.R:160:17: style: Commas should always have a space after.

​      x = iris[,1:3],
                ^

tests/testthat/test-caretList.R:161:17: style: Commas should always have a space after.

​      y = iris[,4],
                ^

tests/testthat/test-caretList.R:205:23: style: Commas should always have a space after.

​            x = iris[,1:3],
                      ^

tests/testthat/test-caretList.R:206:23: style: Commas should always have a space after.

​            y = iris[,4],
                      ^

tests/testthat/test-caretList.R:332:18: style: Commas should never have a space before.

​      y = train[ , "Class"],
                ~^

tests/testthat/test-caretList.R:448:37: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                    ^

tests/testthat/test-caretList.R:448:42: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                         ^

tests/testthat/test-caretList.R:448:45: style: Commas should always have a space after.

​      tuneGrid=data.frame(.cp=c(.01,.001,.1,1))
                                            ^

tests/testthat/test-caretList.R:519:14: style: Commas should always have a space after.

​  x <- iris[,1:3]
             ^

tests/testthat/test-caretList.R:520:14: style: Commas should always have a space after.

​  y <- iris[,4]
             ^

tests/testthat/test-ensembleMethods.R:200:40: style: Commas should always have a space after.

​  mr1 <- mr1[order(mr1$method, mr1$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:201:40: style: Commas should always have a space after.

​  mr2 <- mr2[order(mr2$method, mr2$id),]
                                       ^

tests/testthat/test-ensembleMethods.R:220:70: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                     ^

tests/testthat/test-ensembleMethods.R:220:110: style: Commas should always have a space after.

​  expect_equal(mr_reg_long[order(mr_reg_long$method, mr_reg_long$id),"resid"], mr2[order(mr2$method, mr2$id),"resid"])
                                                                                                             ^

tests/testthat/test-ensembleMethods.R:281:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:282:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"]
                               ^

tests/testthat/test-ensembleMethods.R:286:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:294:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensembleMethods.R:309:20: style: Commas should always have a space after.

​        se=tests[i,"se"],
                   ^

tests/testthat/test-ensembleMethods.R:310:32: style: Commas should always have a space after.

​        return_weights=tests[i,"return_weights"],
                               ^

tests/testthat/test-ensembleMethods.R:315:16: style: Commas should always have a space after.

​    if(tests[i,"se"]){
               ^

tests/testthat/test-ensembleMethods.R:323:16: style: Commas should always have a space after.

​    if(tests[i,"return_weights"]){
               ^

tests/testthat/test-ensemble.R:28:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:28:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-ensemble.R:56:11: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
          ^

tests/testthat/test-ensemble.R:56:23: style: Commas should always have a space after.

​    iris[,1:2], iris[,3], method="lm",
                      ^

tests/testthat/test-helper_functions.R:28:13: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
            ^

tests/testthat/test-helper_functions.R:28:25: style: Commas should always have a space after.

​      iris[,1:2], iris[,5],
                        ^

tests/testthat/test-helper_functions.R:37:13: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
            ^

tests/testthat/test-helper_functions.R:37:39: style: Commas should always have a space after.

​      iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                      ^

tests/testthat/test-helper_functions.R:43:11: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
          ^

tests/testthat/test-helper_functions.R:43:37: style: Commas should always have a space after.

​    iris[,1:2], factor(ifelse(iris[,5]=="setosa", "Yes", "No")),
                                    ^

tests/testthat/test-helper_functions.R:151:93: style: Commas should always have a space after.

​  modelLibrary$nn <- modelLibrary$lm[sample(1:nrow(modelLibrary$lm), nrow(modelLibrary$lm)),]
                                                                                            ^

tests/testthat/test-helper_functions.R:185:18: style: Commas should always have a space after.

​      iris[1:100,-5],
                 ^
zachmayer commented 8 years ago

All right, I'm going to ignore the lint for now. That's the only failure (and AS_CRAN="true" passes):

  testthat results ================================================================
  OK: 629 SKIPPED: 2 FAILED: 1
  1. Failure: Code Lint 
zachmayer commented 8 years ago

:shipit:

zachmayer commented 8 years ago

Wahoo! Passes without issue locally, on travis, and on build_win(). I merged this PR and submitted to CRAN!