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.
|
7 years ago | |
---|---|---|
R | 7 years ago | |
inst/img | 7 years ago | |
man | 7 years ago | |
src | 7 years ago | |
tests | 7 years ago | |
.Rbuildignore | 7 years ago | |
.gitignore | 7 years ago | |
.travis.yml | 7 years ago | |
DESCRIPTION | 7 years ago | |
NAMESPACE | 7 years ago | |
NEWS.md | 7 years ago | |
README.Rmd | 7 years ago | |
README.md | 7 years ago | |
filemagic.Rproj | 7 years ago |
README.md
filemagic
: R interface to libmagic
So you do need to install libmagic
to use this. This should also be pretty straightforward to get working on Windows. Assistance to do that is welcome.
The following functions are implemented:
incant
: returns the mimetype of the files in the input vector (as a data frame)
The following data sets are included:
- (eventually will be an internal mime types db)
Installation
devtools::install_github("hrbrmstr/filemagic")
Usage
library(filemagic)
library(magrittr)
library(dplyr)
system.file("img", package="filemagic") %>%
list.files(full.names=TRUE) %>%
incant() %>%
glimpse()
## Observations: 10
## Variables: 5
## $ file <chr> "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/filemagic/img/example_dir", "/L...
## $ 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", "...
# current verison
packageVersion("filemagic")
## [1] '0.1.0'
Test Results
library(filemagic)
library(testthat)
date()
## [1] "Fri Aug 12 19:47:32 2016"
test_dir("tests/")
## testthat results ========================================================================================================
## OK: 0 SKIPPED: 0 FAILED: 0
##
## DONE ===================================================================================================================