% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/boe_exchange_rate.R
\name{boe_exchange_rate}
\alias{boe_exchange_rate}
\title{Download sterling exchange rates}
\source{
\url{https://www.bankofengland.co.uk/boeapps/database/}
}
\usage{
boe_exchange_rate(
  currency = "USD",
  from = "1975-01-02",
  to = Sys.Date(),
  cache = TRUE
)
}
\arguments{
\item{currency}{Character vector. One or more currency codes. Use
\code{\link[=list_exchange_rates]{list_exchange_rates()}} to see all available currencies. Defaults to
\code{"USD"}.}

\item{from}{Date or character (YYYY-MM-DD). Start date. Defaults to
\code{"1975-01-02"}.}

\item{to}{Date or character (YYYY-MM-DD). End date. Defaults to today.}

\item{cache}{Logical. Use cached data if available (default \code{TRUE}).}
}
\value{
A data frame with columns:
\describe{
\item{date}{Date. Observation date.}
\item{currency}{Character. Currency code (e.g. \code{"USD"}).}
\item{rate}{Numeric. Units of foreign currency per GBP.}
}
}
\description{
Downloads daily spot exchange rates for sterling against major currencies
from the Bank of England. Most series available from January 1975.
}
\examples{
\donttest{
op <- options(boe.cache_dir = tempdir())
# GBP/USD since 2020
boe_exchange_rate("USD", from = "2020-01-01")

# Multiple currencies
boe_exchange_rate(c("USD", "EUR", "JPY"), from = "2020-01-01")
options(op)
}

}
\seealso{
Other exchange rates: 
\code{\link{list_exchange_rates}()}
}
\concept{exchange rates}
