Package 'importar'

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

Help Index


This function imports/loads packages as in 'Python', i.e., “import package as alias”

Description

This function imports/loads packages as in 'Python', i.e., “import package as alias”

Usage

import(package, alias)

Arguments

package

Package name (unquoted).

alias

Alias (unquoted) for the package.

Examples

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”

Description

This function imports/loads functions as in 'Python', i.e., “from package import function as alias”

Usage

import_fun(package, fun, alias)

Arguments

package

Package name (unquoted).

fun

Function name (unquoted).

alias

Alias (unquoted) for the function.

Examples

import_fun(dplyr, filter, fil)
df <- data.frame(a=1:3, b=4:6)
fil(df, a == 2)