-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
50 lines (38 loc) · 1.21 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# importas
<!-- badges: start -->
[![R build status](https://github.com/atusy/importas/workflows/R-CMD-check/badge.svg)](https://github.com/atusy/importas)
[![Codecov test coverage](https://codecov.io/gh/atusy/importas/branch/master/graph/badge.svg)](https://codecov.io/gh/atusy/importas?branch=master)
[![Netlify Status](https://api.netlify.com/api/v1/badges/8604d4c3-52cf-4be2-b434-ef08bc394150/deploy-status)](https://app.netlify.com/sites/importas/deploys)
<!-- badges: end -->
Get objects from packages via aliases of packages and the $ operator.
The `%as%` infix operator works in the way similar to Python's `Import spam as ham`
## Installation
``` r
remotes::install_github("atusy/importas")
```
## Example
```{r}
library(importas)
# Define an alias of a package,
# and access the object from the package via the alias
graphics %as% gr
gr$plot
# A more R-like syntax is
gr <- package(graphics)
# Define aliases at once
importas(ut = utils, st = stats)
ut$str
st$median
```