Skip to content

Instantly share code, notes, and snippets.

@yutannihilation
Created July 12, 2018 11:00
Show Gist options
  • Select an option

  • Save yutannihilation/3b29932aa143cbddeb2e2bfe6d498f81 to your computer and use it in GitHub Desktop.

Select an option

Save yutannihilation/3b29932aa143cbddeb2e2bfe6d498f81 to your computer and use it in GitHub Desktop.
Missingness won't propagate if the default value is set.
func1 <- function(dummy = 1) {
  missing(dummy)
}

func1()
#> [1] TRUE

func2 <- function(dummy = 1) {
  func1(dummy=dummy)
}

func2()
#> [1] FALSE

Created on 2018-07-12 by the reprex package (v0.2.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment