Skip to content

Commit 91d084e

Browse files
committed
Add readme
1 parent 52fc626 commit 91d084e

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
3+
^README\.Rmd$
4+
^README-.*\.png$

README.Rmd

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
output: github_document
3+
---
4+
5+
<!-- README.md is generated from README.Rmd. Please edit that file -->
6+
7+
```{r, include = FALSE}
8+
knitr::opts_chunk$set(
9+
collapse = TRUE,
10+
comment = "#>",
11+
fig.path = "README-"
12+
)
13+
library(blob)
14+
```
15+
16+
# blob
17+
18+
The goal of blob is to provide a simple S3 class to represent a vector of binary objects, aka blobs. The `blob` class is a lightweight wrapper around a list of raw vectors, suitable for inclusion in a data frame.
19+
20+
## Installation
21+
22+
You can install blob from github with:
23+
24+
```{r gh-installation, eval = FALSE}
25+
# install.packages("devtools")
26+
devtools::install_github("hadley/blob")
27+
```
28+
29+
## Example
30+
31+
To create a blob, use `blob()`, `new_blob()` or `as.blob()`:
32+
33+
```{r example}
34+
x1 <- charToRaw("Good morning")
35+
x2 <- as.raw(c(0x48, 0x65, 0x6c, 0x6c, 0x6f))
36+
37+
new_blob(list(x1, x2))
38+
blob(x1, x2)
39+
40+
as.blob(c("Good morning", "Good evening"))
41+
```

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
<!-- README.md is generated from README.Rmd. Please edit that file -->
3+
blob
4+
====
5+
6+
The goal of blob is to provide a simple S3 class to represent a vector of binary objects, aka blobs. The `blob` class is a lightweight wrapper around a list of raw vectors, suitable for inclusion in a data frame.
7+
8+
Installation
9+
------------
10+
11+
You can install blob from github with:
12+
13+
``` r
14+
# install.packages("devtools")
15+
devtools::install_github("hadley/blob")
16+
```
17+
18+
Example
19+
-------
20+
21+
To create a blob, use `blob()`, `new_blob()` or `as.blob()`:
22+
23+
``` r
24+
x1 <- charToRaw("Good morning")
25+
x2 <- as.raw(c(0x48, 0x65, 0x6c, 0x6c, 0x6f))
26+
27+
new_blob(list(x1, x2))
28+
#> [1] blob[12 B] blob[5 B]
29+
blob(x1, x2)
30+
#> [1] blob[12 B] blob[5 B]
31+
32+
as.blob(c("Good morning", "Good evening"))
33+
#> [1] blob[12 B] blob[12 B]
34+
```

0 commit comments

Comments
 (0)