You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.4 KiB

6 years ago
---
output: rmarkdown::github_document
---
6 years ago
`wand` : Retrieve 'Magic' Attributes from Files and Directories
6 years ago
The `libmagic` library must be installed and available to use this.
- `apt-get install libmagic-dev` on Debian-ish systems
- `brew install libmagic` on macOS
Minimum expected version of `libmagic` is 5.28 but it should work with older versions. Note that some fields in the resultant data frame might not be available with older library versions.
The package should also be pretty straightforward to get working on Windows. Assistance to do that is welcome.
6 years ago
The following functions are implemented:
6 years ago
- `incant` : returns the "magic" metadata of the files in the input vector (as a data frame)
- `magic_wand_file` : provides a full path to the package-provided `magic` file
6 years ago
6 years ago
### Installation
```{r eval=FALSE}
6 years ago
devtools::install_github("hrbrmstr/wand")
6 years ago
```
```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}
options(width=120)
```
### Usage
```{r message=FALSE}
6 years ago
library(wand)
library(magrittr)
library(dplyr)
6 years ago
system.file("img", package="wand") %>%
list.files(full.names=TRUE) %>%
incant() %>%
glimpse()
6 years ago
system.file("img", package="wand") %>%
list.files(full.names=TRUE) %>%
incant(magic_wand_file()) %>%
select(description) %>%
unlist(use.names=FALSE)
6 years ago
# current verison
6 years ago
packageVersion("wand")
6 years ago
```
### Test Results
6 years ago
```{r message=FALSE}
6 years ago
library(wand)
6 years ago
library(testthat)
date()
test_dir("tests/")
```