Skip to content

Instantly share code, notes, and snippets.

View JEFworks's full-sized avatar

Jean Fan JEFworks

View GitHub Profile
@JEFworks
JEFworks / pointillism.R
Last active July 30, 2018 12:48
Pointillism filter: Convert an image (RGB array) into array of points in a style reminiscent of pointillism
#' Pointillism filter
#'
#' @description Convert an image (RGB array) into array of points in a style reminiscent of pointillism
#'
#' @param img Image array.
#' @param k Point size. Bigger k means bigger point / less detail.
#' @param seed Random seed for voxel color sampling.
#'
#' @examples {
#' ## Read image
@JEFworks
JEFworks / connectedBarplot.R
Last active September 21, 2017 18:05
Connected Barplot in R for Series Data Visualization
#' Plots a series of barplots and connects them
#' Modified from https://stackoverflow.com/questions/22560850/barplot-with-connected-series
#'
#' @param dat NxM matrix with N rows as features and M columns as samples
#' @param color Vector of N colors
#' @param space Space between barplots
#' @param alpha Alpha for area connecting barplots
#'
#' @examples
#' dat <- matrix(rnorm(100),10,10)