File: README.md

package info (click to toggle)
r-cran-mime 0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 144 kB
  • ctags: 1
  • sloc: ansic: 25; sh: 21; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# mime

[![Build Status](https://travis-ci.org/yihui/mime.svg)](https://travis-ci.org/yihui/mime)

This is an R package for mapping filename extensions to [MIME
types](http://en.wikipedia.org/wiki/Internet_media_type), based on the data
[derived](R/mime.R) from `/etc/mime.types`.

```r
library(mime)
guess_type(c('a/b/c.html', 'd.pdf', 'e.odt', 'foo.docx', 'tex'))
# [1] "text/html"                                                              
# [2] "application/pdf"                                                        
# [3] "application/vnd.oasis.opendocument.text"                                
# [4] "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
# [5] "text/x-tex"
```

You can install the stable version from CRAN, or the development version from
XRAN:

```r
# CRAN version
install.packages('mime', repos = 'https://cran.rstudio.com')
# development version
install.packages('mime', repos = 'http://yihui.name/xran')
```