Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lfe-tidier: add argument robust to tidy #772 #781

Merged
merged 3 commits into from Dec 13, 2019

Conversation

kuriwaki
Copy link
Contributor

@kuriwaki kuriwaki commented Nov 17, 2019

This is the proposed fix to #772. This fix allows the reporting of correct standard errors being reported out, instead of silently giving wrong ones.

@lintr-bot
Copy link

lintr-bot commented Nov 17, 2019

R/aaa-documentation-helper.R:39:7: warning: local variable ‘overwritten’ assigned but may not be used

overwritten <- paste(overwrite, collapse = ", ")
      ^~~~~~~~~~~

R/aaa-documentation-helper.R:64:47: warning: no visible binding for global variable ‘description’

items <- with(glos, purrr::map2_chr(column, description, row_to_item))
                                              ^~~~~~~~~~~

R/aer-tidiers.R:58:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/aer-tidiers.R:66:25: style: There should be a space between right parenthesis and an opening curly brace.

if (n_endogenous > 1){
                        ^~

R/boot-tidiers.R:16:3: warning: local variable ‘sim’ assigned but may not be used

sim <- boot.out$sim
  ^~~

R/boot-tidiers.R:17:3: warning: local variable ‘cl’ assigned but may not be used

cl <- boot.out$call
  ^~

R/boot-tidiers.R:22:3: warning: local variable ‘rn’ assigned but may not be used

rn <- paste("t", index, "*", sep = "")
  ^~

R/boot-tidiers.R:62:12: warning: Avoid 1:ncol(...) expressions, use seq_len.

index <- 1:ncol(boot.out$t)
           ^

R/boot-tidiers.R:117:7: style: Place a space before left parenthesis, except in a function call.

if(conf.method == "norm"){
      ^

R/boot-tidiers.R:117:29: style: There should be a space between right parenthesis and an opening curly brace.

if(conf.method == "norm"){
                            ^~

R/broom-package.R:45:1: style: Trailing blank lines are superfluous.

^

R/broom.R:40:1: style: Trailing blank lines are superfluous.

^

R/btergm-tidiers.R:25:17: style: There should be a space between right parenthesis and an opening curly brace.

#' for(i in 1:10){
                ^~

R/btergm-tidiers.R:64:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/drc-tidiers.R:104:1: style: functions should have cyclomatic complexity of less than 15, this has 20.

augment.drc <- function(x, data = NULL, newdata = NULL,
^

R/emmeans-tidiers.R:194:5: style: Place a space before left parenthesis, except in a function call.

if("term" %in% colnames(ret)) {
    ^

R/epiR-tidiers.R:9:1: style: Lines should not be more than 100 characters.

#' @evalRd return_tidy("term", estimate = "Estimated measure of association", "conf.low", "conf.high", "statistic", "df", "p.value")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/epiR-tidiers.R:11:1: style: Lines should not be more than 100 characters.

#' @details The tibble has a column for each of the measures of association or tests contained in `massoc` when 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/epiR-tidiers.R:27:60: style: Commas should always have a space after.

tidy.epi.2by2 <- function(x, parameters = c("moa", "stat"),...) {
                                                           ^

R/geepack-tidiers.R:42:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/glmnet-glmnet-tidiers.R:64:47: warning: Avoid 1:ncol(...) expressions, use seq_len.

​      fix_data_frame(as.matrix(b), newnames = 1:ncol(b), newcol = "term")
                                              ^

R/glmnet-glmnet-tidiers.R:71:18: warning: Avoid 1:ncol(...) expressions, use seq_len.

newnames = 1:ncol(beta),
                 ^

R/gmm-tidiers.R:85:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/hmisc-tidiers.R:61:1: style: Trailing blank lines are superfluous.

^

R/hmisc-tidiers.R:62:1: style: Trailing blank lines are superfluous.

^

R/lavaan-tidiers.R:97:1: style: Lines should not be more than 100 characters.

#' For further recommendations on reporting SEM and CFA models see Schreiber, J. B. (2017). Update to core reporting practices in structural equation modeling. Research in Social and Administrative Pharmacy, 13(3), 634-643. https://doi.org/10.1016/j.sapharm.2016.06.006
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/lfe-tidiers.R:55:5: style: Place a space before left parenthesis, except in a function call.

if(has_multi_response) {
    ^

R/lfe-tidiers.R:79:1: style: Lines should not be more than 100 characters.

​      select(term, contains("effect"),  contains("se"), obs, comp) %>% # effect and se are multiple if multiple y
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/lfe-tidiers.R:80:15: style: Put spaces around all infix operators.

​      rename(N=obs) 
             ~^~

R/lfe-tidiers.R:82:7: style: Place a space before left parenthesis, except in a function call.

if(has_multi_response) {
      ^

R/lfe-tidiers.R:85:70: style: Put spaces around all infix operators.

tidyr::separate(col = "stat_resp", c("stat", "response"), sep="\\.") %>% 
                                                                    ~^~

R/lfe-tidiers.R:87:9: style: Commented code should be removed.

# nn <-  c("response", nn)
        ^~~~~~~~~~~~~~~~~~~~~~~~

R/lfe-tidiers.R:159:5: style: Place a space before left parenthesis, except in a function call.

if(has_multi_response) {
    ^

R/lm-beta-tidiers.R:43:26: style: Remove spaces before the left parenthesis in a function call.

tidy.lm.beta <- function (x, conf.int = FALSE, conf.level = 0.95,
                         ^

R/lm-beta-tidiers.R:53:34: style: Remove spaces before the left parenthesis in a function call.

tidy.summary.lm.beta <- function (x, ...) {
                                 ^

R/lm-beta-tidiers.R:58:42: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- map_df(co, fix_data_frame, nn[1:ncol(co[[1]])], 
                                         ^

R/lm-beta-tidiers.R:64:34: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                                 ^

R/lm-beta-tidiers.R:68:1: style: Trailing blank lines are superfluous.

^

R/lmtest-tidiers.R:30:60: warning: Avoid 1:ncol(...) expressions, use seq_len.

nn <- c("estimate", "std.error", "statistic", "p.value")[1:ncol(co)]
                                                           ^

R/maps-tidiers.R:28:15: warning: Avoid 1:nrow(...) expressions, use seq_len.

df$order <- 1:nrow(df)
              ^

R/mass-rlm-tidiers.R:96:1: style: Trailing blank lines are superfluous.

^

R/mass-rlm-tidiers.R:97:1: style: Trailing blank lines are superfluous.

^

R/mclust-tidiers.R:65:45: style: There should be a space between right parenthesis and an opening curly brace.

​  } else if (is.null(dim(x$parameters$mean))){
                                            ^~

R/mediate-tidiers.R:10:1: style: Lines should not be more than 100 characters.

#' @details The tibble has four rows. The first two indicate the mediated effect in the control and treatment group, respectively. And the last two the direct effect in each group.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/mediate-tidiers.R:25:7: warning: local variable ‘lower2’ assigned but may not be used

lower2 <- lower <- quantile(theta, lower.inv)
      ^~~~~~

R/mediate-tidiers.R:27:7: warning: local variable ‘upper2’ assigned but may not be used

upper2 <- upper <- quantile(theta, upper.inv)
      ^~~~~~

R/mediate-tidiers.R:27:68: style: There should be a space between right parenthesis and an opening curly brace.

tidy.mediate <- function(x, conf.int = FALSE, conf.level = .95, ...){
                                                                   ^~

R/mediate-tidiers.R:28:1: style: Lines should not be more than 100 characters.

d0 <- d1 <- z0 <- z1 <- d0.sims <- d1.sims <- z0.sims <- z1.sims <- d0.p <- d1.p <- z0.p <- z1.p <- NULL
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/mediate-tidiers.R:34:21: style: Do not place spaces around code in parentheses or square brackets.

​             tibble( c("acme_0", "acme_1", "ade_0", "ade_1"), 
                    ^

R/mediate-tidiers.R:36:49: style: Commas should never have a space before.

​                     c(sd(d0.sims), sd(d1.sims) , sd(z0.sims), sd(z1.sims)),
                                               ~^

R/mediate-tidiers.R:40:5: style: Place a space before left parenthesis, except in a function call.

if(conf.int){
    ^

R/mediate-tidiers.R:40:14: style: There should be a space between right parenthesis and an opening curly brace.

if(conf.int){
             ^~

R/mediate-tidiers.R:41:28: style: Put spaces around all infix operators.

low <- (1 - conf.level)/2
                          ~^~

R/mediate-tidiers.R:43:28: style: There should be a space between right parenthesis and an opening curly brace.

BC.CI <- function(theta){
                           ^~

R/mediate-tidiers.R:44:50: style: Put spaces around all infix operators.

z.inv <- length(theta[theta < mean(theta)])/sims
                                                ~^~

R/mediate-tidiers.R:48:31: style: Opening curly braces should never go on their own line and should always be followed by a new line.

under <- 6 * (sum(U^2))^{3/2}
                              ^

R/mediate-tidiers.R:48:33: style: Put spaces around all infix operators.

under <- 6 * (sum(U^2))^{3/2}
                               ~^~

R/mediate-tidiers.R:48:35: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

under <- 6 * (sum(U^2))^{3/2}
                                  ^

R/mediate-tidiers.R:50:47: style: Put spaces around all infix operators.

lower.inv <-  pnorm(z + (z + qnorm(low))/(1 - a * (z + qnorm(low))))
                                             ~^~

R/mediate-tidiers.R:50:48: style: Place a space before left parenthesis, except in a function call.

lower.inv <-  pnorm(z + (z + qnorm(low))/(1 - a * (z + qnorm(low))))
                                               ^

R/mediate-tidiers.R:52:48: style: Put spaces around all infix operators.

upper.inv <-  pnorm(z + (z + qnorm(high))/(1 - a * (z + qnorm(high))))
                                              ~^~

R/mediate-tidiers.R:52:49: style: Place a space before left parenthesis, except in a function call.

upper.inv <-  pnorm(z + (z + qnorm(high))/(1 - a * (z + qnorm(high))))
                                                ^

R/mediate-tidiers.R:58:7: style: Place a space before left parenthesis, except in a function call.

if(s$boot.ci.type != "bca"){
      ^

R/mediate-tidiers.R:58:31: style: There should be a space between right parenthesis and an opening curly brace.

if(s$boot.ci.type != "bca"){
                              ^~

R/mediate-tidiers.R:59:27: style: There should be a space between right parenthesis and an opening curly brace.

CI <- function(theta){
                          ^~

R/mediate-tidiers.R:71:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/mgcv-tidiers.R:53:1: style: Lines should not be more than 100 characters.

CI <- suppressMessages(stats::confint.default(x, level = conf.level)[rownames(px), ,drop = FALSE])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/mgcv-tidiers.R:53:91: style: Commas should always have a space after.

CI <- suppressMessages(stats::confint.default(x, level = conf.level)[rownames(px), ,drop = FALSE])
                                                                                          ^

R/muhaz-tidiers.R:53:1: style: Trailing blank lines are superfluous.

^

R/nobs.R:1:1: style: Lines should not be more than 100 characters.

#`stats::nobs` is a standard function to retrieve the number of observations used to fit a model. Unfortunately, Some packages do not define a `stats::nobs.MODEL` method. This file fills-in those missing methods. Ideally, we should offload these methods by submitting them for adoption in the upstream packages.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pam-tidiers.R:11:1: style: Lines should not be more than 100 characters.

#'   max.diss = "Maximal dissimilarity between the observations in the cluster and that cluster's medoid.",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pam-tidiers.R:12:1: style: Lines should not be more than 100 characters.

#'   avg.diss = "Average dissimilarity between the observations in the cluster and that cluster's medoid.", 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pam-tidiers.R:44:49: warning: Avoid 1:ncol(...) expressions, use seq_len.

tidy.pam <- function(x, col.names = paste0("x", 1:ncol(x$medoids)), ...) {
                                                ^

R/plm-tidiers.R:80:41: style: Only use double-quotes.

ret <- tibble(r.squared = s$r.squared['rsq'],
                                        ^~~~~

R/plm-tidiers.R:81:45: style: Only use double-quotes.

adj.r.squared = s$r.squared['adjrsq'],
                                            ^~~~~~~~

R/quantreg-rq-tidiers.R:13:1: style: Lines should not be more than 100 characters.

#'   `summary.rq` and `statistic` and `p.value` values are not returned. When only a single predictor is included in the model, 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/quantreg-rqs-tidiers.R:83:1: style: Trailing blank lines are superfluous.

^

R/robust-glmrob-tidiers.R:2:3: warning: local variable ‘s’ assigned but may not be used

s <- summary(x)
  ^

R/robust-glmrob-tidiers.R:22:25: style: Remove spaces before the left parenthesis in a function call.

tidy.glmRob <- function (x, ...){
                        ^

R/robust-glmrob-tidiers.R:22:32: style: There should be a space between right parenthesis and an opening curly brace.

tidy.glmRob <- function (x, ...){
                               ^~

R/robust-lmrob-tidiers.R:23:24: style: Remove spaces before the left parenthesis in a function call.

tidy.lmRob <- function (x, ...){
                       ^

R/robust-lmrob-tidiers.R:23:31: style: There should be a space between right parenthesis and an opening curly brace.

tidy.lmRob <- function (x, ...){
                              ^~

R/robust-lmrob-tidiers.R:56:21: warning: Avoid 1:nrow(...) expressions, use seq_len.

rows <- split(df, 1:nrow(df))
                    ^

R/robustbase-glmrob-tidiers.R:19:25: style: Remove spaces before the left parenthesis in a function call.

tidy.glmrob <- function (x, conf.int = FALSE, conf.level = 0.95, ...) {
                        ^

R/sp-tidiers.R:10:5: warning: local variable ‘order’ assigned but may not be used

order <- 1:nrow(pieces)
    ^~~~~

R/sp-tidiers.R:10:5: warning: local variable ‘order’ assigned but may not be used

order <- 1:nrow(pieces)
    ^~~~~

R/sp-tidiers.R:13:5: warning: local variable ‘group’ assigned but may not be used

group <- interaction(id, piece)
    ^~~~~

R/sp-tidiers.R:13:5: warning: local variable ‘group’ assigned but may not be used

group <- interaction(id, piece)
    ^~~~~

R/sp-tidiers.R:33:21: warning: Avoid 1:nrow(...) expressions, use seq_len.

coords$order <- 1:nrow(coords)
                    ^

R/sp-tidiers.R:58:14: warning: Avoid 1:nrow(...) expressions, use seq_len.

order <- 1:nrow(pieces)
             ^

R/sp-tidiers.R:71:15: warning: Avoid 1:nrow(...) expressions, use seq_len.

df$order <- 1:nrow(df)
              ^

R/sp-tidiers.R:95:14: warning: Avoid 1:nrow(...) expressions, use seq_len.

order <- 1:nrow(pieces)
             ^

R/sp-tidiers.R:108:15: warning: Avoid 1:nrow(...) expressions, use seq_len.

df$order <- 1:nrow(df)
              ^

R/speedglm-speedglm-tidiers.R:85:1: style: Trailing blank lines are superfluous.

^

R/speedglm-speedlm-tidiers.R:78:8: style: Commented code should be removed.

#    speedglm::speedglm(hp ~ log(mpg), mtcars, fitted = TRUE)
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/speedglm-speedlm-tidiers.R:97:1: style: Trailing blank lines are superfluous.

^

R/stats-anova-tidiers.R:75:5: style: Place a space before left parenthesis, except in a function call.

if("term" %in% names(ret)){
    ^

R/stats-anova-tidiers.R:75:28: style: There should be a space between right parenthesis and an opening curly brace.

if("term" %in% names(ret)){
                           ^~

R/stats-glm-tidiers.R:2:3: warning: local variable ‘s’ assigned but may not be used

s <- summary(x)
  ^

R/stats-kmeans-tidiers.R:5:1: style: Lines should not be more than 100 characters.

#' @param col.names Dimension names. Defaults to the names of the variables in x.  Set to NULL to get names `x1, x2, ...`.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/stats-kmeans-tidiers.R:34:5: style: Place a space before left parenthesis, except in a function call.

if(is.null(col.names)){
    ^

R/stats-kmeans-tidiers.R:34:24: style: There should be a space between right parenthesis and an opening curly brace.

if(is.null(col.names)){
                       ^~

R/stats-kmeans-tidiers.R:35:30: warning: Avoid 1:ncol(...) expressions, use seq_len.

col.names <- paste0("x", 1:ncol(x$centers))
                             ^

R/stats-lm-tidiers.R:88:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/stats-lm-tidiers.R:148:1: style: Lines should not be more than 100 characters.

#'   df = "The degrees for freedom from the numerator of the overall F-statistic. This is new in broom 0.7.0. Previously, this reported the rank of the design matrix, which is one more than the numerator degrees of freedom of the overall F-statistic.",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/stats-lm-tidiers.R:186:3: style: Commented code should be removed.

# getAnywhere('format.perc')
  ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/stats-loess-tidiers.R:43:1: style: Trailing blank lines are superfluous.

^

R/stats-mlm-tidiers.R:35:4: style: Commented code should be removed.

#ret <- tidy.summary.mlm(s)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/stats-mlm-tidiers.R:41:47: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- purrr::map_df(co, fix_data_frame, nn[1:ncol(co[[1]])],
                                              ^

R/stats-prcomp-tidiers.R:50:1: style: Lines should not be more than 100 characters.

#' @details See https://stats.stackexchange.com/questions/134282/relationship-between-svd-and-pca-how-to-use-svd-to-perform-pca
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/stats-prcomp-tidiers.R:110:7: warning: Avoid 1:nrow(...) expressions, use seq_len.

1:nrow(x$rotation)
      ^

R/stats-prcomp-tidiers.R:122:43: warning: Avoid 1:nrow(...) expressions, use seq_len.

labels <- if (is.null(rownames(x$x))) 1:nrow(x$x) else rownames(x$x)
                                          ^

R/stats-tidiers.R:29:1: style: Lines should not be more than 100 characters.

#' function is an `nXm` matrix, as opposed to a `1Xm` vector, the input matrix is first flattened into a `1X(m*n)` vector
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/stats-tidiers.R:73:34: style: Only use double-quotes.

ret <- as_tibble(m, rownames = 'item1')
                                 ^~~~~~~

R/stats-tidiers.R:87:1: style: Trailing blank lines are superfluous.

^

R/stats-tidiers.R:88:1: style: Trailing blank lines are superfluous.

^

R/stats-tidiers.R:89:1: style: Trailing blank lines are superfluous.

^

R/stats-tidiers.R:90:1: style: Trailing blank lines are superfluous.

^

R/survival-coxph-tidiers.R:79:25: style: There should be a space between right parenthesis and an opening curly brace.

if (! is.null(x$frail)){
                        ^~

R/survival-coxph-tidiers.R:87:23: style: There should be a space between right parenthesis and an opening curly brace.

if (is.null(x$frail)){
                      ^~

R/survival-survreg-tidiers.R:43:5: style: Place a space before left parenthesis, except in a function call.

if(conf.int){
    ^

R/survival-survreg-tidiers.R:43:14: style: There should be a space between right parenthesis and an opening curly brace.

if(conf.int){
             ^~

R/systemfit-tidiers.R:61:1: style: Trailing blank lines are superfluous.

^

R/tseries-tidiers.R:35:32: warning: Avoid 1:ncol(...) expressions, use seq_len.

ret <- fix_data_frame(co, nn[1:ncol(co)])
                               ^

R/utilities.R:6:5: style: Commented code should be removed.

#   mouse = gerbil
    ^~~~~~~~~~~~~~

R/utilities.R:61:36: warning: Avoid 1:nrow(...) expressions, use seq_len.

​  any(rownames(df) != as.character(1:nrow(df)))
                                   ^

R/utilities.R:142:1: style: functions should have cyclomatic complexity of less than 15, this has 27.

augment_columns <- function(x, data, newdata = NULL, type, type.predict = type,
^

R/utilities.R:433:32: style: Do not place spaces around code in parentheses or square brackets.

if (identical(x, quote(expr = ))) {
                               ^

R/zoo-tidiers.R:42:17: warning: Avoid 1:ncol(...) expressions, use seq_len.

​  colnames(ret)[1:ncol(x)] <- colnames(x)
                ^

tests/spelling.R:1:3: style: Place a space before left parenthesis, except in a function call.

if(requireNamespace('spelling', quietly = TRUE))
  ^

tests/spelling.R:1:21: style: Only use double-quotes.

if(requireNamespace('spelling', quietly = TRUE))
                    ^~~~~~~~~~

tests/testthat/test-aer.R:71:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-drc.R:9:16: style: Put spaces around all infix operators.

mod <- drm(dead/total~conc, type,
              ~^~

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

dat <- matrix(c(13,2163,5,3349), nrow = 2, byrow = TRUE)
                   ^

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

dat <- matrix(c(13,2163,5,3349), nrow = 2, byrow = TRUE)
                        ^

tests/testthat/test-epiR.R:5:27: style: Commas should always have a space after.

dat <- matrix(c(13,2163,5,3349), nrow = 2, byrow = TRUE)
                          ^

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

birthwt$low <- factor(birthwt$low, levels = c(1,0))
                                                ^

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

birthwt$smoke <- factor(birthwt$smoke, levels = c(1,0))
                                                    ^

tests/testthat/test-epiR.R:15:51: style: Commas should always have a space after.

birthwt$race <- factor(birthwt$race, levels = c(1,2,3))
                                                  ^

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

birthwt$race <- factor(birthwt$race, levels = c(1,2,3))
                                                    ^

tests/testthat/test-ergm.R:29:5: style: Commented code should be removed.

# check_dims(tde, 2, 7)
    ^~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-ergm.R:37:5: style: Commented code should be removed.

# check_dims(td2, 2, 7)
    ^~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-gam.R:30:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-joineRML.R:11:3: style: Commented code should be removed.

# `R/sysdata.rda`
  ^~~~~~~~~~~~~~~

tests/testthat/test-lfe.R:20:37: style: Commas should never have a space before.

fit_multi <- lfe::felm(v1 + v2 ~ v3 , df)
                                   ~^

tests/testthat/test-lfe.R:90:1: style: Lines should not be more than 100 characters.

​  expect_error(augment(fit_multi), "Augment does not support linear models with multiple responses.")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-mass-polr.R:47:37: style: Only use double-quotes.

au <- augment(fit, type.predict = 'class')
                                    ^~~~~~~

tests/testthat/test-mass-polr.R:48:25: style: Only use double-quotes.

​  expect_is(au$.fitted, 'factor')
                        ^~~~~~~~

tests/testthat/test-mass-polr.R:49:36: style: Only use double-quotes.

​  expect_equal(predict(fit, type = 'class'), au$.fitted)
                                   ^~~~~~~

tests/testthat/test-mediate.R:37:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-mgcv.R:27:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-mgcv.R:28:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-muhaz.R:30:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-ordinal.R:42:1: style: Lines should not be more than 100 characters.

info = "The terms (and their order) should be unaffected by whether `conf.int` = TRUE or `conf.int` = FALSE.")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-ordinal.R:94:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-pam.R:39:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-plm.R:43:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-polca.R:42:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-polca.R:43:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-quantreg-rq.R:14:16: style: Put spaces around all infix operators.

dflarge_n <- df%>% slice(rep(row_number(), 500))
              ~^

tests/testthat/test-robustbase.R:18:5: style: Commented code should be removed.

# check_arguments(glance.glmrob)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-sp.R:99:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-speedglm-speedlm.R:59:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-stats-anova.R:94:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-stats-glm.R:68:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-stats-htest.R:65:5: style: Commented code should be removed.

# gl <- glance(pht)
    ^~~~~~~~~~~~~~~~~

tests/testthat/test-stats-htest.R:75:5: style: Commented code should be removed.

# gl <- glance(ptt)
    ^~~~~~~~~~~~~~~~~

tests/testthat/test-stats-htest.R:117:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-stats-prcomp.R:69:30: style: Place a space before left parenthesis, except in a function call.

C <- chol(S <- toeplitz(.9^(0:31)))
                             ^

tests/testthat/test-survival-survdiff.R:63:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-survival-survexp.R:34:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-survival-survfit.R:49:1: style: Trailing blank lines are superfluous.

^

@alexpghayes alexpghayes merged commit f57c5e1 into tidymodels:master Dec 13, 2019
@alexpghayes
Copy link
Collaborator

alexpghayes commented Dec 13, 2019

Thanks for this PR! I realized I closed this a bit hastily -- will you please open an additional PR and update NEWS and add yourself as a contributor in DESCRIPTION?

@kuriwaki
Copy link
Contributor Author

kuriwaki commented Dec 13, 2019

Thanks for this PR! I realized I closed this a bit hastily -- will you please open an additional PR and update NEWS and add yourself as a contributor in DESCRIPTION?

thanks! It's now in #803.

alexpghayes pushed a commit that referenced this pull request Dec 13, 2019
* Add robust option to tidy.felm, to be passed to lfe::summary.felm

* use a042ea3 with multiple response options case as well

* tests for tidy.lfe robust = TRUE

* update news and contributor for #772, updated in PR #781
kuriwaki added a commit to kuriwaki/broom that referenced this pull request Feb 5, 2020
kuriwaki added a commit to kuriwaki/broom that referenced this pull request Jun 12, 2020
…lm()` now has a `robust = TRUE/FALSE` option that supports robust

  and cluster standard errors, following the defaults of lfe:::summary.felm.
  (tidymodels#781 and tidymodels#818 by @kuriwaki)"
@github-actions
Copy link

github-actions bot commented Mar 7, 2021

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants