Enables Importing/Loading of Packages or Functions While Creating an Alias for Them

Enables 'Python'-like importing/loading of packages or functions with aliasing to prevent namespace conflicts.


The goal of 'importar' is to prevent namespace conflicts by having loaded a lot of R packages. So 'importar' makes it easy to assign a (short) alias to a package or a function.

Installation

You can install 'importar' from GitHub with:

devtools::install_github("andreaphsz/importar")

or from CRAN with:

install.packages("importar")

Example

This is an example which shows you how to assign a short alias to the 'dplyr' package.

## assign 'd' to 'dplyr' and use 'dplyr' functions by invoking the '$' operator.
import(dplyr, d)
df <- data.frame(a=1:3, b=4:6)
df %>% d$filter(a == 2)

You can also assign an alias to functions to prevent namespace conflicts.

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

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("importar")

0.1.1 by Andrea Cantieni, a year ago


https://github.com/andreaphsz/importar


Browse source code at https://github.com/cran/importar


Authors: Andrea Cantieni


Documentation:   PDF Manual  


GPL-3 license


Imports utils

Suggests dplyr


See at CRAN