Reputation: 969
I want to create an R package, but I'm completely new in this topic, and even though I've already checked some excellent resources like Hadley Wickham's R packages book, I've a couple of questions that I'd like to clarify:
stats
package to make use of the lm
function?%>%
in the magrittr
package since I can not write library(magrittr)
?Any help is greatly appreciated!
Upvotes: 0
Views: 255
Reputation: 109864
Do I need to import the stats package to make use of the lm function?
No. It's loaded automatically. You only need to import for packages not loaded when R boots (like lattice)
How can I make use of the piping operator %>% in the magrittr package since I can not write library(magrittr)?
I'd import it as Hadley does HERE in dplyr:
#' @importFrom magrittr %>%
#' @name %>%
#' @export
#' @rdname chain
#' @usage lhs \%>\% rhs
NULL
If you're not using roxygen2 to document I'd really recommend it, but if you're reading Hadley's tutorial you probably will go that route.
Upvotes: 3