I have a lot of segfault errors ever since version 0.4.1. They are always hard to pin down so I just downgraded to 0.4.0 for a while. Now I am able to reproduce one consistently using the development version of dplyr on my computer (Mac OS X 10.5.5). Here is what I do: start R, copy & paste the code in the console, get segfault error. I am getting similar errors with other code it's just hard to reproduce them. This one happens consistently. The code works without the mutate at the end of the pipe or when I change the mutate arguments.
code with segfault error
# load libraries
library("rvest")
library("magrittr")
library("tidyr")
library("dplyr")
library("readr")
sessionInfo()
# get data
odmp <- rvest::html("http://www.odmp.org/search/year/1998") %>%
# extract data from webpage
html_node("#secondary-layout-two-column-one-body") %>%
html_nodes("table") %>%
extract2(1) %>%
html_table(fill = TRUE) %>%
magrittr::extract(1:178,) %>%
setNames(c("logo", "cell", "empty")) %>%
separate(cell, c("name", "agency", "date", "cause"), "\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t") %>%
mutate(logo = NULL)
error message
*** caught segfault ***
address 0x0, cause 'memory not mapped'
Traceback:
1: .Call("dplyr_mutate_impl", PACKAGE = "dplyr", df, dots)
2: mutate_impl(.data, dots)
3: mutate_.tbl_df(tbl_df(.data), .dots = dots)
4: mutate_(tbl_df(.data), .dots = dots)
5: as.data.frame(mutate_(tbl_df(.data), .dots = dots))
6: mutate_.data.frame(.data, .dots = lazyeval::lazy_dots(...))
7: mutate_(.data, .dots = lazyeval::lazy_dots(...))
8: mutate(., logo = NULL)
9: function_list[[k]](value)
10: withVisible(function_list[[k]](value))
11: freduce(value, `_function_list`)
12: `_fseq`(`_lhs`)
13: eval(expr, envir, enclos)
14: eval(quote(`_fseq`(`_lhs`)), env, env)
15: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
16: odmp %>% html_node("#secondary-layout-two-column-one-body") %>% html_nodes("table") %>% extract2(1) %>% html_table(fill = TRUE) %>% magrittr::extract(1:178, ) %>% setNames(c("logo", "cell", "empty")) %>% separate(cell, c("name", "agency", "date", "cause"), "\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t") %>% mutate(logo = NULL)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readr_0.1.1 dplyr_0.4.2.9002 tidyr_0.2.0 magrittr_1.5 rvest_0.1.0 Defaults_1.1-1
loaded via a namespace (and not attached):
[1] assertthat_0.1 DBI_0.3.1 httr_1.0.0 parallel_3.1.3 R6_2.0 Rcpp_0.12.0 stringi_0.4-1 stringr_1.0.0 tools_3.1.3