diff --git a/NAMESPACE b/NAMESPACE index ed3455c..76ce3ac 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -63,7 +63,6 @@ importFrom(ggplot2,theme) importFrom(ggplot2,theme_classic) importFrom(ggplot2,waiver) importFrom(lifecycle,deprecated) -importFrom(locateip,locate_ip) importFrom(magrittr,`%>%`) importFrom(purrr,map_dfr) importFrom(rlang,abort) @@ -77,4 +76,3 @@ importFrom(testthat,expect_warning) importFrom(testthat,test_that) importFrom(tictoc,tic) importFrom(tictoc,toc) -importFrom(wikirest,get_most_viewed_per_country) diff --git a/R/clessnverse.R b/R/clessnverse.R index 8e56b81..9744883 100644 --- a/R/clessnverse.R +++ b/R/clessnverse.R @@ -1,11 +1,13 @@ -# Suppress R CMD check note -#' @importFrom locateip locate_ip -#' @importFrom wikirest get_most_viewed_per_country -NULL - -# Show message when loading package +#' @title Package Attach Hook Function +#' @description This function is automatically called when the `clessnverse` package is attached using `library(clessnverse)`. +#' It ensures that the `sondr` package is also loaded, making all its functions available in the user's session. +#' Additionally, it displays a startup message with a disclaimer about the maintenance status of `clessnverse`. +#' @keywords internal .onAttach <- function(libname, pkgname) { - packageStartupMessage("DISCLAIMER: As of July 2023, `clessnverse` is no longer under active development. - + if (require("sondr", character.only = TRUE, quietly = TRUE)) { + packageStartupMessage("DISCLAIMER: As of July 2023, `clessnverse` is no longer under active development. To avoid breaking dependencies, the package remains available \"as is\" with no warranty of any kind.") -} + } else { + warning("Package 'sondr' is not available. Some functionality may be missing.") + } +} \ No newline at end of file diff --git a/man/dot-onAttach.Rd b/man/dot-onAttach.Rd new file mode 100644 index 0000000..7748ce0 --- /dev/null +++ b/man/dot-onAttach.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/clessnverse.R +\name{.onAttach} +\alias{.onAttach} +\title{Package Attach Hook Function} +\usage{ +.onAttach(libname, pkgname) +} +\description{ +This function is automatically called when the \code{clessnverse} package is attached using \code{library(clessnverse)}. +It ensures that the \code{sondr} package is also loaded, making all its functions available in the user's session. +Additionally, it displays a startup message with a disclaimer about the maintenance status of \code{clessnverse}. +} +\keyword{internal}