ImportAs
Idiomatic Python Shorthand Imports
Install / Use
/learn @jonocarroll/ImportAsREADME
importAs
This package helps mimic the idiomatic python importing of packages such as
import dplyr as d
In order to mimic this as closely as possible, the function importAs
takes a package name and a (short?) name for that and creates a linkage.
Helpful information is provided when printing and within the RStudio
Environment pane
importAs(dplyr, d)
#> Namespace 'dplyr' can be referenced as 'd'
## or ##
dplyr %importAs% d
#> Namespace 'dplyr' can be referenced as 'd'
d
#> Namespace 'dplyr' can be referenced as 'd'
#> [1] "dplyr"

d::filter(mtcars, cyl == 4, am == 1)
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> 1 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
#> 2 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1
#> 3 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2
#> 4 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1
#> 5 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1
#> 6 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2
#> 7 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
#> 8 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2
For full details, see the vignette ‘namespace-shorthands’.
Installation
You can install the development version of importAs with
## install.packages("devtools")
devtools::install_github("jonocarroll/importAs")
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
