inir
is a .ini
/.cfg
file parser
About .ini
/.cfg
files: the INI file Wikipedia page
install.packages("devtools")
devtools::install_github("sckott/inir")
library("inir")
Get a file
gitfile <- system.file("examples", "gitconfig.ini", package = "inir")
instantiate new object with file path
(res <- ini(gitfile))
#> <<ini config file>> gitconfig.ini.
get file path
res$file
#> [1] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/inir/examples/gitconfig.ini"
read file
res$read()
#> $gitconfig.ini
#> <<ini config file>> gitconfig.ini
#> sections (length):
#> core: 6
#> remote "origin": 2
#> branch "master": 2
#> travis: 1
get section names
res$sections()
#> [1] "core" "remote \"origin\"" "branch \"master\""
#> [4] "travis"
get contents of a single section
res$get("core")
#> $repositoryformatversion
#> [1] "0"
#>
#> $filemode
#> [1] "true"
#>
#> $bare
#> [1] "false"
#>
#> $logallrefupdates
#> [1] "true"
#>
#> $ignorecase
#> [1] "true"
#>
#> $precomposeunicode
#> [1] "true"
inir
in R doing citation(package = 'inir')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.