melt.array

0th

Percentile

Melt an array.

This code is conceptually similar to as.data.frame.table

Keywords
manip
Usage
# S3 method for array
melt(data, varnames = names(dimnames(data)), ...,
  na.rm = FALSE, as.is = FALSE, value.name = "value")

# S3 method for table melt(data, varnames = names(dimnames(data)), ..., na.rm = FALSE, as.is = FALSE, value.name = "value")

# S3 method for matrix melt(data, varnames = names(dimnames(data)), ..., na.rm = FALSE, as.is = FALSE, value.name = "value")

Arguments
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 FALSE, the default, dimnames will be converted using type.convert. If TRUE, they will be left as strings.

value.name

name of variable used to store values

See Also

cast

Other melt methods: melt.data.frame, melt.default, melt.list

Aliases
  • melt.array
  • melt.table
  • melt.matrix
Examples
# NOT RUN {
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)
# }
Documentation reproduced from package reshape2, version 1.4.3, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.