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

dplyr do() crashes if it returns a complex value #1120

Closed
jakeyeung opened this issue May 4, 2015 · 2 comments
Closed

dplyr do() crashes if it returns a complex value #1120

jakeyeung opened this issue May 4, 2015 · 2 comments
Assignees
Milestone

Comments

@jakeyeung
Copy link

@jakeyeung jakeyeung commented May 4, 2015

I want to use do() to transform data into complex values, but it is consistently crashing when I try to do so.

Example:

library(dplyr)

ComplexFunction <- function(dat){
  x.trans <- exp(1i)
  return(data.frame(x.trans = x.trans))
}

test.df <- data.frame(x = seq(20), labs = rep(c("a", "b"), 10))

test.crashes <- test.df %>%
  group_by(labs) %>%
  do(ComplexFunction(.))

Running this causes RStudio to crash. It seems to crash when it tries to return a complex value.

Any suggestions on how to handle this?

@hadley
Copy link
Member

@hadley hadley commented May 19, 2015

This works for me. Can you please try the dev version?

@hadley hadley added this to the 0.4.2 milestone May 19, 2015
@hadley hadley closed this May 21, 2015
@jakeyeung
Copy link
Author

@jakeyeung jakeyeung commented Jun 15, 2015

Thanks, running the code in the dev version solves it.

library(devtools)
dev_mode()

devtools::install_github("hadley/lazyeval")
devtools::install_github("hadley/dplyr")

library(dplyr)

ComplexFunction <- function(dat){
  x.trans <- exp(1i)
  return(data.frame(x.trans = x.trans))
}

test.df <- data.frame(x = seq(20), labs = rep(c("a", "b"), 10))

test.crashes <- test.df %>%
  group_by(labs) %>%
  do(ComplexFunction(.))

dev_mode()

@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants