Title: | Enables Importing/Loading of Packages or Functions While Creating an Alias for Them |
---|---|
Description: | Enables 'Python'-like importing/loading of packages or functions with aliasing to prevent namespace conflicts. |
Authors: | Andrea Cantieni |
Maintainer: | Andrea Cantieni <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2024-10-31 22:08:59 UTC |
Source: | https://github.com/andreaphsz/importar |
This function imports/loads packages as in 'Python', i.e., “import package as alias”
import(package, alias)
import(package, alias)
package |
Package name (unquoted). |
alias |
Alias (unquoted) for the package. |
import(dplyr, d) df <- data.frame(a=1:3, b=4:6) df %>% d$filter(a == 2)
import(dplyr, d) df <- data.frame(a=1:3, b=4:6) df %>% d$filter(a == 2)
This function imports/loads functions as in 'Python', i.e., “from package import function as alias”
import_fun(package, fun, alias)
import_fun(package, fun, alias)
package |
Package name (unquoted). |
fun |
Function name (unquoted). |
alias |
Alias (unquoted) for the function. |
import_fun(dplyr, filter, fil) df <- data.frame(a=1:3, b=4:6) fil(df, a == 2)
import_fun(dplyr, filter, fil) df <- data.frame(a=1:3, b=4:6) fil(df, a == 2)