View source: R/library_call_linter.R
library_call_linter | R Documentation |
Force library calls to all be at the top of the script.
library_call_linter(allow_preamble = TRUE)
allow_preamble |
Logical, default |
best_practices, configurable, readability, style
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "
library(dplyr)
print('test')
library(tidyr)
",
linters = library_call_linter()
)
lint(
text = "
library(dplyr)
print('test')
library(tidyr)
library(purrr)
",
linters = library_call_linter()
)
# okay
lint(
text = "
library(dplyr)
print('test')
",
linters = library_call_linter()
)
lint(
text = "
# comment
library(dplyr)
",
linters = library_call_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.