loading...

This is the same as library(dplyr) or library(tidyr), but excluding all functions that end with an underscore and that may conflict with {svTidy} corresponding ones. Note that these functions are deprecated in recent versions of {dplyr} and {tidyr}, and they are even defunct in version 1.2.0 or greater of {dplyr}.

library_dplyr(..., exclude)

library_tidyr(..., exclude)

Arguments

...

Further arguments passed to base::library()

exclude

A list of functions to exclude. Leave this argument missing to exclude all underscore functions from the package by default.

Value

The list of attached packages invisibly, or TRUE/FALSE to indicate success if logical.return = TRUE is indicated.

See also

Examples

library_dplyr()
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:svTidy’:
#> 
#>     all_of, is.grouped_df
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
library_tidyr()
#> 
#> Attaching package: ‘tidyr’
#> The following object is masked from ‘package:svTidy’:
#> 
#>     all_of
search()
#>  [1] ".GlobalEnv"        "package:tidyr"     "package:dplyr"    
#>  [4] "package:svTidy"    "package:stats"     "package:graphics" 
#>  [7] "package:grDevices" "package:utils"     "package:datasets" 
#> [10] "package:methods"   "SciViews:TempEnv"  "Autoloads"        
#> [13] "package:base"     
# However, the functions with underscore are not directly accessible
# (unless you make library(svTidy) of course)
get0('mutate_')
#> function (.data = (.), ..., .by = NULL, .keep = "all", .before = NULL, 
#>     .after = NULL, .cols = NULL) 
#> {
#>     if (!prepare_data_dot(.data)) 
#>         return(recall_with_data_dot())
#>     if (!is.character(.keep)) 
#>         stop("{.arg .keep} must be a string or character vector.")
#>     if (length(.keep) != 1L) 
#>         stop("{.arg .keep} must be a single string, not a vector of length {.val {length(.keep)}}.")
#>     .keep <- .keep
#>     if (fmatch(.keep, c("all", "used", "unused", "none"), 0L) == 
#>         0L) 
#>         stop("{.arg .keep} must be one of \"all\", \"used\", \"unused\", or \"none\", not \"{(.keep)}\".")
#>     is_grouped <- is_grouped_df(.data)
#>     if (missing(...)) 
#>         return(.data)
#>     no_se_msg <- gettext("Standard evaluation is not supported for grouped data frames.")
#>     args <- formula_masking(..., .make.names = TRUE, .no.se = is_grouped, 
#>         .no.se.msg = no_se_msg)
#>     if (!missing(.by)) {
#>         if (is_grouped) 
#>             stop("can't supply {.arg .by} when {.arg .data} is a grouped data frame.")
#>         if (!args$are_formulas) 
#>             abort(no_se_msg)
#>         res <- group_by_vars(.data, by = .by, sort = FALSE)
#>     }
#>     else {
#>         res <- .data
#>     }
#>     res <- do.call(fmutate, c(list(.data = res), args$dots, list(.keep = force(.keep), 
#>         .cols = force(.cols))), envir = args$env)
#>     if (!missing(.by)) 
#>         res <- fungroup(res)
#>     if (!missing(.before) || !missing(.after)) {
#>         stop("{.arg .before} and {.arg .after} are not implemented yet in {.fun mutate_}.", 
#>             i = "Use {.fun mutate} instead.")
#>     }
#>     res
#> }
#> <bytecode: 0x55d4e5cbcad8>
#> <environment: namespace:svTidy>
#> attr(,"class")
#> [1] "function"    "sciviews_fn"