-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
70 lines (49 loc) · 1.91 KB
/
README.Rmd
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![Build Status](https://travis-ci.org/VictorSuarezL/imaggar.svg?branch=master)](https://travis-ci.org/VictorSuarezL/imaggar)
[![Codecov test coverage](https://codecov.io/gh/VictorSuarezL/imaggar/branch/master/graph/badge.svg)](https://codecov.io/gh/VictorSuarezL/imaggar?branch=master)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
<!-- badges: end -->
# imaggar
R client for accessing IMAGGA’s REST API. Do you want to know how to access IMAGGA API from R? Here is your package. `imaggar` is an easygoing and tidy friendly package.
## Installation
You can install the released version of imaggar from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("imaggar")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("VictorSuarezL/imaggar")
```
## Tagger Example
This is a basic example which shows you how to use `ima_tag` function:
```{r echo=FALSE, message=TRUE, warning=TRUE}
magick::image_read("https://upload.wikimedia.org/wikipedia/commons/7/73/Lion_waiting_in_Namibia.jpg")
```
With the code below we call IMAGGA API to tag the lion image:
```{r example, eval=FALSE}
library(imaggar)
api_key <- "xxx_f0273ebca9e09dc"
api_secret <- "xxx40eed126f1870dc3736063f546b83"
image_path <- "https://upload.wikimedia.org/wikipedia/commons/7/73/Lion_waiting_in_Namibia.jpg"
ima_tag(image_path, api_key = api_key, api_secret = api_secret)
```
```{r load data, include=FALSE}
load("./R/sysdata.rda")
tag_output <- tibble::as_tibble(tag_output)
```
```{r echo=FALSE}
tag_output
```