Melt an array.
This code is conceptually similar to as.data.frame.table
## S3 method for class 'array' melt( data, varnames = names(dimnames(data)), ..., na.rm = FALSE, as.is = FALSE, value.name = "value" ) ## S3 method for class 'table' melt( data, varnames = names(dimnames(data)), ..., na.rm = FALSE, as.is = FALSE, value.name = "value" ) ## S3 method for class 'matrix' melt( data, varnames = names(dimnames(data)), ..., na.rm = FALSE, as.is = FALSE, value.name = "value" )
data |
array to melt |
varnames |
variable names to use in molten data.frame |
... |
further arguments passed to or from other methods. |
na.rm |
Should NA values be removed from the data set? This will convert explicit missings to implicit missings. |
as.is |
if |
value.name |
name of variable used to store values |
Other melt methods:
melt.data.frame()
,
melt.default()
,
melt.list()
a <- array(c(1:23, NA), c(2,3,4)) melt(a) melt(a, na.rm = TRUE) melt(a, varnames=c("X","Y","Z")) dimnames(a) <- lapply(dim(a), function(x) LETTERS[1:x]) melt(a) melt(a, varnames=c("X","Y","Z")) dimnames(a)[1] <- list(NULL) melt(a)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.