π¨ Help, please, #RStats people!
What R functions do you tell students *not* to use?
e.g. I tell students not to use `attach()` or `setwd()`, and to use `read_csv()` (from readr) instead of `read.csv()`. What other functions should students avoid like the plague?
What R functions do you tell students *not* to use?
e.g. I tell students not to use `attach()` or `setwd()`, and to use `read_csv()` (from readr) instead of `read.csv()`. What other functions should students avoid like the plague?
Comments
* get()/assign()
* rm(list = ls())
* require()
* parallel::detectCores()
* closeAllConnections()
* sink(..., type = "message")
* https://do.call("fcn_name")
* tryCatch(..., warning = ...)
* x == TRUE/x == FALSE
But, using tryCatch(..., warning = ...) is rarely what people want - any warning causes tryCatch() to exit immediately, e.g.
> x <- c(1, 2, -1)
> y <- 0
> tryCatch({ y <- log(x); 2*y }, warning = function(w) { message("skip warning") })
skip warning
> y
0