---
title: "How to use the GoogleImage2array function"
author: 
- name: Satoshi Kume
  email: satoshi.kume.1984@gmail.com
date: "`r Sys.Date()`"
graphics: no
package: GoogleImage2Array
output:
    BiocStyle::html_document:
        toc_float: false
vignette: >
    %\VignetteIndexEntry{How to use GoogleImage2array}
    %\VignetteIndexEntry{GoogleImage2Array}
    %\VignetteEncoding{UTF-8}
    %\VignetteEngine{knitr::rmarkdown}
editor_options: 
  chunk_output_type: console
---

```{r style, echo = FALSE, results = 'asis', message=FALSE}
BiocStyle::markdown()
```

**Last modified:** `r file.info("HowToUse.Rmd")$mtime`<br />
**Compiled**: `r date()`

# Install & load packages

```{r echo=TRUE, eval=FALSE}
library(GoogleImage2Array)
library(EBImage)
library(magrittr)
```

# Get images via Google Image Search

`GoogleImage2array` function provide an array of images via google image search.

```{r echo=TRUE, eval=FALSE}
#Search by persian cat
query <- "persian cat"
CatImg <- GoogleImage2array(query)

#show info
str(CatImg)

#Search by Shiba inu
query <- "Shiba inu"
DogImg <- GoogleImage2array(query)

#show info
str(DogImg)

#Bind arrays
ImgDat <- unname(EBImage::abind(CatImg$array, DogImg$array, along=1))

#show info
str(ImgDat)

```

# Display images

`display.array` show a result as a tiled image.

```{r echo=TRUE, eval=FALSE}
#show CatImg
display.array(CatImg)

#show DogImg
display.array(DogImg)

```

# Session information {.unnumbered}
```{r sessionInfo, echo=FALSE}
sessionInfo()
```
