# importar

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)``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.6819278,"math_prob":0.72813886,"size":708,"snap":"2022-40-2023-06","text_gpt3_token_len":210,"char_repetition_ratio":0.12642045,"word_repetition_ratio":0.0,"special_character_ratio":0.2838983,"punctuation_ratio":0.14666666,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9824072,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-06T03:07:17Z\",\"WARC-Record-ID\":\"<urn:uuid:5448247c-57a7-406c-a4ca-02798d5380e5>\",\"Content-Length\":\"7335\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b114f712-003d-4e8c-9cef-485bcb8906c4>\",\"WARC-Concurrent-To\":\"<urn:uuid:da31c9ed-7f01-49a6-9ec2-2db5953feca5>\",\"WARC-IP-Address\":\"137.208.57.37\",\"WARC-Target-URI\":\"https://cran.r-project.org/web/packages/importar/readme/README.html\",\"WARC-Payload-Digest\":\"sha1:2TE5HKLOJWAI6ZXA57O2XJHHH3KSTWBY\",\"WARC-Block-Digest\":\"sha1:AMCTD54VL4PB5ERC53ZVDO3BRLCNFDV2\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500303.56_warc_CC-MAIN-20230206015710-20230206045710-00329.warc.gz\"}"}