juliasilge/widyr

pairwise_count error in amazon linux inside EMR

joscani opened this issue · 3 comments

Hi. I install widyr in EMR and I get error with simple examples

library(widyr)
library(dplyr)
dat <- data_frame(group = rep(1:5, each = 2),
                  letter = c("a", "b",
                             "a", "c",
                             "a", "c",
                             "b", "e",
                             "b", "f"))

# count the number of times two letters appear together
pairwise_count(dat, letter, group)
Error: `n` = value must be a symbol or a string, not formula

I think is a problem with dplyr, but I install last version of dplyr without problem.

My session info is


R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2017.03

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] widyr_0.1.0.9000 bindrcpp_0.2     dplyr_0.7.4     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14      compiler_3.4.1    git2r_0.19.0      plyr_1.8.4        bindr_0.1         tokenizers_0.1.4  tools_3.4.1      
 [8] digest_0.6.12     memoise_1.1.0     tibble_1.3.4      nlme_3.1-131      lattice_0.20-35   pkgconfig_2.0.1   rlang_0.1.4.9000 
[15] Matrix_1.2-10     psych_1.7.8       curl_3.0          parallel_3.4.1    knitr_1.17        janeaustenr_0.1.5 withr_2.1.0      
[22] stringr_1.2.0     httr_1.3.1        devtools_1.13.4   grid_3.4.1        glue_1.2.0        R6_2.2.2          foreign_0.8-69   
[29] tidyr_0.7.2       reshape2_1.4.2    purrr_0.2.4       magrittr_1.5      SnowballC_0.5.1   assertthat_0.2.0  tidytext_0.1.5   
[36] mnormt_1.5-5      stringi_1.1.6     broom_0.4.3 

Any idea? yesterday the function works great but today we have launched a new cluster emr with the same init script

Hmm, that's worrisome (and I unfortunately can't reproduce). Could you share the results of traceback()?

Today the example works, It seems like the amazon guys fix their configuration of rstudio and R. I think they have been fixed their amazon linux ami.
Thanks for your great package.

I am getting the same error while running the same query!
Error: n= value must be a symbol or a string, not a formula Callrlang::last_error()` to see a backtrace

traceback()
21: stop(cnd)
20: .abort(text)
19: glubort(fmt_named_calls(named_calls), ..., .envir = .envir)
18: bad_named_calls(named_call, "must be a symbol or a string, not {actual_type}")
17: (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]])
16: mapply(FUN = f, ..., SIMPLIFY = FALSE)
15: Map(.f, .x, .y, ...)
14: map2(exprs, names(exprs), switch_rename)
13: rename_vars(names(.data), !(!(!quos(...))))
12: rename.data.frame(., n = value)
11: rename(., n = value)
10: function_list[k]
9: withVisible(function_list[k])
8: freduce(value, _function_list)
7: _fseq(_lhs)
6: eval(quote(_fseq(_lhs)), env, env)
5: eval(quote(_fseq(_lhs)), env, env)
4: withVisible(eval(quote(_fseq(_lhs)), env, env))
3: tbl %>% distinct_(.dots = c(item, feature), .keep_all = TRUE) %>%
mutate(..value = 1) %>% func(item, feature, wt) %>% rename(n = value)
2: pairwise_count_(tbl, col_name(substitute(item)), col_name(substitute(feature)),
wt = col_name(substitute(wt)), ...)
1: pairwise_count(dat, letter, group)`