% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lookup.R
\name{add_island_cols}
\alias{add_island_cols}
\title{Add island classification columns to a data frame}
\usage{
add_island_cols(
  .data,
  code_col,
  cols = c("iso_code", "is_sids", "is_snij", "sids_tier", "political_association",
    "wb_region", "wb_income_group")
)
}
\arguments{
\item{.data}{A data frame.}

\item{code_col}{String. Name of the column in \code{.data} that holds
country names or ISO codes.}

\item{cols}{Character vector of columns from \code{islands} to attach.
Defaults to the most common classification fields.}
}
\value{
\code{.data} with the requested columns appended. Rows whose
  \code{code_col} value cannot be resolved get \code{NA} in the new
  columns.
}
\description{
Left-joins selected columns from \code{\link{islands}} onto an
existing data frame, matching on a column of country names or ISO
codes. Designed for tidy pipelines but written in base R, so it works
with plain data frames, tibbles, and (read-only) data.tables.
}
\examples{
df <- data.frame(
  country = c("Aruba", "Curacao", "Bonaire", "Brazil"),
  gdp = c(3.5, 3.1, 0.5, 1900)
)
add_island_cols(df, "country")

}
