File: melt.array.Rd

package info (click to toggle)
r-cran-reshape2 1.4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 292 kB
  • sloc: cpp: 246; sh: 9; makefile: 5
file content (75 lines) | stat: -rw-r--r-- 1,601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/melt.r
\name{melt.array}
\alias{melt.array}
\alias{melt.table}
\alias{melt.matrix}
\title{Melt an array.}
\usage{
\method{melt}{array}(
  data,
  varnames = names(dimnames(data)),
  ...,
  na.rm = FALSE,
  as.is = FALSE,
  value.name = "value"
)

\method{melt}{table}(
  data,
  varnames = names(dimnames(data)),
  ...,
  na.rm = FALSE,
  as.is = FALSE,
  value.name = "value"
)

\method{melt}{matrix}(
  data,
  varnames = names(dimnames(data)),
  ...,
  na.rm = FALSE,
  as.is = FALSE,
  value.name = "value"
)
}
\arguments{
\item{data}{array to melt}

\item{varnames}{variable names to use in molten data.frame}

\item{...}{further arguments passed to or from other methods.}

\item{na.rm}{Should NA values be removed from the data set? This will
convert explicit missings to implicit missings.}

\item{as.is}{if \code{FALSE}, the default, dimnames will be converted
using \code{\link{type.convert}}. If \code{TRUE}, they will be left
as strings.}

\item{value.name}{name of variable used to store values}
}
\description{
This code is conceptually similar to \code{\link{as.data.frame.table}}
}
\examples{
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)
}
\seealso{
\code{\link{cast}}

Other melt methods: 
\code{\link{melt.data.frame}()},
\code{\link{melt.default}()},
\code{\link{melt.list}()}
}
\concept{melt methods}
\keyword{manip}