audioHist {audiolyzR}R Documentation

Generate an audiolyzR version of a Histogram


Generates a histogram and translates it to audiolyzR format.


  audioHist(x, name = "Variable", purge.plots = FALSE,
            bins = 30, breaks = "Scott", radius = floor(sqrt(bins))-1, 
            key = "C", quality = "Major", tempo = 80, reverb = 1,
            directory = file.path (Sys.getenv("R_LIBS_USER"), "audiolyzR"),
            output = file.path (tempdir(), "json_matrix"), = NULL, ...)



A vector of values to be plotted as a histogram, of form data.frame$variable.


A character string specifying the name of x. This will be used to label the plots. The default is "Variable".


Specifies whether to erase existing audiolyzR plots that the synthesizer accesses. Default is FALSE, so plots will pile up unless you change it to TRUE.


Optional specification of bins for hex binning step. Default is 30.


Optional specification of breaks for the histogram. Default is "Scott".


Used to obtain the number of nearest neighbors for each bin/point. Default is the square root of number of bins.


Optional, not yet fully implemented. The desired key for the audio matrix. This can be adjusted manually in the audiolyzR synthesizer.


Optional. Quality of the specified key. Default is "Major". This is not yet fully implemented, and can be changed manually in the synthesizer.


Optional. Tempo to set as default (You can change it manually in the synthesizer later). Default is 115 beats per minute.


Optional. A number between 0 and 1 (inclusive) that specifies the amount of reverb in the resulting audio plot. A value of 1 is no reverb while a value of 0 produces the most.


The path of the parent directory containing the audiolyzR synthesizer. This defaults to the "audiolyzR" folder in your "R_LIBS_USER" directory.


This is simply a temporary directory by default. If you wish to change it, the only sensible option is the HOME directory. Included for transparency.

The standalone synthesizer application will look in your HOME directory for plot files when it opens. R will request permission to write there during the current session. If you refuse, it will still work, but you will need to drag the appropriate folder to the synthesizer (a message will explain how). Adjusting this in the function call will have no effect.


Additional arguments to be fed to hexbin() and hist().


Sends a JSON file to the audiolyzR synthesizer, and by default, plots the corresponding histogram in R.

External Application Instructions

The audiolyzR package requires a free standalone synthesizer application. the first time you run an audio*Plot* function, the program will download and install automatically. By default, the app installs into the file.path (Sys.getenv("R_LIBS_USER"), "audiolyzR") directory, which is where the package's functions will look for it. You are free to install it whereever you like, but you must specify its parent directory in your function calls.

If you prefer to install it yourself:

audiolyzR application for Mac:

audiolyzR application for Windows:

Side Effects

Saves a file to the output directory in order to generate audio. Also, by default, a plot will be produced in the graphics window.


Eric Stone, Jesse Garrison



See Also




  ##Basic audioScatter example
  ## Not run: 
  audioHist(NHANES$Diet.Iron, name="Dietary Iron")
## End(Not run)

[Package audiolyzR version 0.4-9 Index]