hirsutosa

knitr::opts_chunk$set(
  comment = "#>",
  collapse = TRUE,
  warning = FALSE,
  message = FALSE
)

Build Status rstudio mirror downloads cran version codecov.io

An R client for Pilosa

Installation

remotes::install_github("ropenscilabs/hirsutosa")
library('hirsutosa')

Install Pilosa

See https://www.pilosa.com/docs/latest/installation/

Getting started

Start Pilosa

pilosa server

or similar if running on Docker, etc.

Create an index

hirs_index_create("repository")

Creat a frame

hirs_frame_create("repository", "stargazer", 
    time_quantum = "YMD", inverse_enabled = TRUE)

And another

hirs_frame_create("repository", "language")

Import data

This part has to be done on the command line, sorry.

Download data

curl -O https://raw.githubusercontent.com/pilosa/getting-started/master/stargazer.csv
curl -O https://raw.githubusercontent.com/pilosa/getting-started/master/language.csv

Import data into Pilosa

pilosa import -i repository -f stargazer stargazer.csv
pilosa import -i repository -f language language.csv

Get indices

hirs_index_get()
#> <pilosa indexes>
#>  index: repository
#>   frames:
#>     language
#>       views (n): 1
#>     stargazer
#>       views (n): 3663

Example queries

Which repositories did user 14 star:

hirs_search("repository", 'Bitmap(frame="stargazer", rowID=14)')

What are the top 5 languages in the sample data:

hirs_search("repository", 'TopN(frame="language", n=5)')

Meta

rofooter



ropenscilabs/hirsutosa documentation built on May 11, 2022, 6:50 a.m.