% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CompadreDB-Subsetting.R
\name{CompadreDB-Subsetting}
\alias{CompadreDB-Subsetting}
\alias{[,CompadreDB,ANY,ANY,ANY-method}
\alias{subset.CompadreDB}
\title{Subsetting CompadreDB objects}
\usage{
\S4method{[}{CompadreDB,ANY,ANY,ANY}(x, i, j, ..., drop = FALSE)

\method{subset}{CompadreDB}(x, subset, select, drop = FALSE, ...)
}
\arguments{
\item{x}{A \code{CompadreDB} object}

\item{i}{row indices (see \link{[.data.frame})}

\item{j}{column indices (see \link{[.data.frame})}

\item{...}{ignored}

\item{drop}{ignored}

\item{subset}{logical expression indicating which rows to keep}

\item{select}{expression indicating which columns to keep}
}
\value{
No return value, called for side effects
}
\description{
\code{CompadreDB} objects can be subset just like a regular
\code{data.frame}, using either \code{[} or \code{subset()}. Note, however,
that returning a valid \code{CompadreDB} object requires the \code{mat}
column. If a column subset excludes \code{mat}, a plain tabular object is
returned instead of a \code{CompadreDB}.
}
\examples{
# subset to the first 10 rows
Compadre[1:10, ]

# subset to the species 'Echinacea angustifolia'
subset(Compadre, SpeciesAccepted == "Echinacea angustifolia")

# remove the column SurvivalIssue
Compadre[, names(Compadre) != "SurvivalIssue"]

subset(Compadre, select = c("SpeciesAccepted", "Authors"))
}
