#' @title function1
#'
#' @return
#' @export
function1 = function() {
cat("this is pkg1's function1 \n")
function2()
}
#' @title function2
#'
#' @return
#' @export
function2 = function() {
cat("this is pkg1's function2 \n")
}
#' @title function3
#'
#' @return
#' @export
function3 = function() {
cat("this is pkg1's function2 \n")
bla = sapply(1:3, function1)
}
#' @title function8
#'
#' @return
#' @export
function8 = function() {
cat("this is pkg1's function8 \n")
function47()
function7 = function() {
cat("internally defined function7")
}
function8 = function() {
cat("internally defined function8")
}
function7()
function8()
}
#what if function not exported?
#' @title .function00
#'
#' @return
.function00 = function() {
cat("this is pkg1's non-exported function00 \n")
}
#' @title function9
#'
#' @return
#' @export
function9 = function() {
cat("this is pkg1's function9 \n")
function24()
data.frame(x = c(1, 2)) %>% dplyr::filter(x == 1)
function2 = 4
3 -> function1
}
#' @importFrom testpkg2 function24
#' @title function11
#'
#' @return
#' @export
function11 = function() {
cat("this is pkg1's function11 which calls an internally defined function \n") # won't be picked up
bla = function() {
cat("bla\n")
}
bla() %>% print()
}
#' @importFrom magrittr %>%
#' @export %>%
NULL
#' @import testpkg2
NULL
#`%>%` = function() {
# cat("tst %>%")
#}
#' @title function11
#'
#' @return
#' @export
function67 = function(x = 0) {
cat("this is pkg1's function67 which calls an internally defined function \n") # won't be picked up
function1 = function() {
cat("internally defined function with name clash \n")
}
function1()
if (x) {
function1 = 2
}
# still searches for function name in other namespaces
function1()
function7
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.