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.

67 lines
1.8 KiB

6 years ago
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. 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)
6 years ago
The following data sets are included:
- (eventually will be an internal mime types db)
### Installation
``` r
6 years ago
devtools::install_github("hrbrmstr/wand")
6 years ago
```
### Usage
``` r
6 years ago
library(wand)
library(magrittr)
library(dplyr)
6 years ago
system.file("img", package="wand") %>%
list.files(full.names=TRUE) %>%
incant() %>%
glimpse()
```
## Observations: 10
## Variables: 5
6 years ago
## $ file <chr> "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/wand/img/example_dir", "/Librar...
## $ mime_type <chr> "inode/directory", "text/x-c", "text/html", "text/plain", "text/rtf", "image/jpeg", "applicatio...
## $ encoding <chr> "binary", "us-ascii", "us-ascii", "us-ascii", "us-ascii", "binary", "binary", "binary", "us-asc...
## $ extensions <chr> NA, "???", "???", "???", "???", "jpeg/jpg/jpe/jfif", "???", "???", "???", "???"
## $ description <chr> "directory", "C source, ASCII text", "HTML document, ASCII text, with CRLF line terminators", "...
6 years ago
``` r
6 years ago
# current verison
6 years ago
packageVersion("wand")
6 years ago
```
## [1] '0.1.0'
### Test Results
``` r
6 years ago
library(wand)
6 years ago
library(testthat)
6 years ago
date()
```
6 years ago
## [1] "Fri Aug 12 22:22:17 2016"
6 years ago
``` r
test_dir("tests/")
```
## testthat results ========================================================================================================
## OK: 0 SKIPPED: 0 FAILED: 0
##
## DONE ===================================================================================================================