NMFimage2df: ggplot2 dataframe from NMF image data

Description Usage Arguments Details Value Examples

View source: R/data.R

Description

ggplot2 dataframe from NMF image data

Usage

1
NMFimage2df(nmfimage, rs, cs)

Arguments

nmfimage

- data for NMF - each row is an image

rs

- number of rows in each image

cs

- number of cols in each image

Details

transform a typical basis data frame to something that can be displayed as images with ggplot2. Each image is a row and the dimensions need to be passed in.

Value

data frame for use with ggplot2

Examples

1
2
3
4
data(faces)
j<-NMFimage2df(faces, 32, 32)
ggplot(filter(j, ID <= 16), aes(x=Var2, y=33-Var1, fill=Brightness)) +
geom_tile() + facet_wrap(~ID) + scale_fill_gradient(low="black", high="white")

richardbeare/pNMF documentation built on June 30, 2020, 6:33 p.m.