I am trying to run a simple example from dplyr help, but lately I am getting this strange error:
> library(tidyverse) > dplyr::rename(iris, petal_length = Petal.Length) ERRROR: `petal_length` = Petal.Length must be a symbol or a string, not formula
Can someone tell me what is going on?
> traceback() 11: stop(cnd) 10: .abort(text) 9: glubort(fmt_named_calls(named_calls), ..., .envir = .envir) 8: bad_named_calls(named_call, "must be a symbol or a string, not {actual_type}") 7: (function (expr, name) { switch_type(expr, string = , symbol = return(as_string(expr)), language = if (is_data_pronoun(expr)) { args <- node_cdr(expr) return(switch_rename(node_cadr(args))) } else { abort("Expressions are currently not supported in `rename()`") }) actual_type <- friendly_type(type_of(expr)) named_call <- ll(`:=`(!(!name), expr)) bad_named_calls(named_call, "must be a symbol or a string, not {actual_type}") })(dots[[1L]][[1L]], dots[[2L]][[1L]]) 6: mapply(FUN = f, ..., SIMPLIFY = FALSE) 5: Map(.f, .x, .y, ...) 4: map2(exprs, names(exprs), switch_rename) 3: rename_vars(names(.data), !(!(!quos(...)))) 2: rename.data.frame(iris, petal_length = Petal.Length) 1: dplyr::rename(iris, petal_length = Petal.Length) > conflicts(detail=TRUE) $`package:dplyr` [1] "filter" "lag" "intersect" "setdiff" "setequal" "union" $`package:stats` [1] "filter" "lag" $`package:methods` [1] "body<-" "kronecker" $`package:base` [1] "body<-" "intersect" "kronecker" "setdiff" "setequal" "union"
Session Information:
> sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so locale: [1] LC_CTYPE=pl_PL.UTF-8 LC_NUMERIC=C LC_TIME=pl_PL.UTF-8 [4] LC_COLLATE=pl_PL.UTF-8 LC_MONETARY=pl_PL.UTF-8 LC_MESSAGES=pl_PL.UTF-8 [7] LC_PAPER=pl_PL.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=pl_PL.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] forcats_0.2.0 stringr_1.2.0 dplyr_0.7.4 purrr_0.2.4 readr_1.1.1 [6] tidyr_0.7.2 tibble_1.3.4 ggplot2_2.2.1 tidyverse_1.2.1 loaded via a namespace (and not attached): [1] Rcpp_0.12.14 cellranger_1.1.0 compiler_3.4.2 [4] plyr_1.8.4 bindr_0.1 tools_3.4.2 [7] jsonlite_1.5 lubridate_1.7.1 nlme_3.1-131 [10] gtable_0.2.0 lattice_0.20-35 pkgconfig_2.0.1 [13] rlang_0.1.4.9000 psych_1.7.8 cli_1.0.0 [16] rstudioapi_0.7.0-9000 yaml_2.1.15 parallel_3.4.2 [19] haven_1.1.0 bindrcpp_0.2 withr_2.1.0 [22] xml2_1.1.1 httr_1.3.1 hms_0.4.0 [25] grid_3.4.2 glue_1.2.0 R6_2.2.2 [28] readxl_1.0.0 foreign_0.8-69 sessioninfo_1.0.1.9000 [31] reshape2_1.4.2 modelr_0.1.1 magrittr_1.5 [34] clisymbols_1.2.0 scales_0.5.0 rvest_0.3.2 [37] assertthat_0.2.0 mnormt_1.5-5 colorspace_1.3-2 [40] stringi_1.1.6 lazyeval_0.2.1 munsell_0.4.3 [43] broom_0.4.3 crayon_1.3.4
source share