% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as.data.frame.R
\docType{methods}
\name{as.data.frame-methods}
\alias{as.data.frame-methods}
\alias{as.data.frame}
\alias{as.data.frame,ANY-method}
\alias{as.data.frame,magpie-method}
\title{~~ Methods for Function as.data.frame ~~}
\usage{
\S4method{as.data.frame}{magpie}(x, rev = 1, raw = FALSE)
}
\arguments{
\item{x}{A MAgPIE-object}

\item{rev}{The revision of the algorithm that should be used for conversion.
rev=1 creates columns with the predefined names Cell, Region, Year, Data1,
Data2,... and Value, rev=2 uses the set names of the MAgPIE object for
naming and adds an attribute "dimtype" to the data.frame which contains
information about the types of the different columns (spatial, temporal,
data or value), rev=3 is identical to rev=2 except that characters are
not being converted to factors (stringsAsFactors = FALSE).}

\item{raw}{Logical to control whether years beginning with "y" should be
converted to integers (without "y") and coordinates should be converted to
numerics. If set to raw columns are returned as they are in the initial
object.}
}
\description{
~~ Methods for function \code{as.data.frame} ~~
}
\section{Methods}{
 \describe{

\item{list("signature(x = \"magpie\")")}{ Conversion creates columns for
Cell, Region, Year, Data1, Data2,... and Value } }
}

\examples{

pop <- maxample("pop")
head(as.data.frame(pop))
head(as.data.frame(pop, rev = 2))

a <- maxample("animal")
head(as.data.frame(a, rev = 3))
head(as.data.frame(a, rev = 3, raw = TRUE))
attr(as.data.frame(a, rev = 3), "dimtype")

}
\seealso{
Other MAgPIE-Conversions: 
\code{\link{as.RasterBrick}()},
\code{\link{as.SpatRaster}()},
\code{\link{as.SpatRasterDataset}()},
\code{\link{as.SpatVector}()},
\code{\link{as.array-methods}},
\code{\link{as_tibble.magpie}()},
\code{\link{unwrap}()},
\code{\link{wrap}()}
}
\concept{MAgPIE-Conversions}
\keyword{methods}
