Skip to content

fifelse followup #3740

@jangorecki

Description

@jangorecki
  • names of test could be retained
fifelse(c(a=T,b=F), 1:2, 2:1)
#[1] 1 1
ifelse(c(a=T,b=F), 1:2, 2:1)
#a b 
#1 1 
  • recycling here needs to be fixed, AFAIU might result into segfault - PR propose to remove this feature
fifelse(c(TRUE, FALSE), 1:2, list(0L))
#[1]         1 544979712
ifelse(c(TRUE, FALSE), 1:2, list(0L))
#[[1]]
#[1] 1
#
#[[2]]
#[1] 0
  • coerce int to double when desired (but not double to int, as in base::ifelse)
str(ifelse(c(T,F),c(1,2),11:12))
# num [1:2] 1 12
str(ifelse(c(T,F),1:2,c(11,12)))
# num [1:2] 1 12
str(ifelse(c(T,F),1:2,c(11,12)))
#Error in fifelse
  • remove hutils, dplyr code from examples, pass --run-dontrun
  • remove console output in examples
  • int64 support NAs

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions