validate: Symbol validation

View source: R/validate.R

validateR Documentation

Symbol validation

Description

Validate symbols before retrieving data. This function checks whether the provided ticker strings are valid according to the Yahoo Finance API.

Usage

validate(symbol = NULL, index = NA, return_logical = FALSE)

Arguments

symbol

A character vector of one or more ticker strings, index or fund names (e.g., c("AAPL", "MSFT")).

index

Deprecated. Use symbol instead.

return_logical

A logical value indicating whether to return a named logical vector. If FALSE (default), returns a character vector containing only the valid symbols. If TRUE, returns a named logical vector indicating validation status (TRUE/FALSE) for each symbol.

Details

Symbol validation

Value

If return_logical = FALSE (the default), a character vector of valid symbols. If return_logical = TRUE, a named logical vector indicating validation status for each symbol. Matching is case-insensitive; returned symbols and names retain the caller's spelling and order, including dots.

Examples

## Not run: 
validate("AAPL")
validate(c("AAPL", "NOTASTOCK", "MSFT"))
validate(c("AAPL", "NOTASTOCK", "MSFT"), return_logical = TRUE)

## End(Not run)


yahoofinancer documentation built on Nov. 17, 2026, 9:06 a.m.