knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE )
An R client for Pilosa
remotes::install_github("ropenscilabs/hirsutosa")
library('hirsutosa')
See https://www.pilosa.com/docs/latest/installation/
pilosa server
or similar if running on Docker, etc.
hirs_index_create("repository")
hirs_frame_create("repository", "stargazer", time_quantum = "YMD", inverse_enabled = TRUE)
And another
hirs_frame_create("repository", "language")
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
hirs_index_get() #> <pilosa indexes> #> index: repository #> frames: #> language #> views (n): 1 #> stargazer #> views (n): 3663
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)')
hirsutosa
in R doing citation(package = 'hirsutosa')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.