R/get_accounts.R

Defines functions get_accounts

Documented in get_accounts

#' Get data related to your RobinHood account
#'
#' @param RH object of class RobinHood
#' @import httr magrittr
#' @export
#' @examples
#' \dontrun{
#' # Login in to your RobinHood account
#' RH <- RobinHood("username", "password")
#'
#' get_accounts(RH)
#'}
get_accounts <- function(RH) {

    # Check if RH is valid
    RobinHood::check_rh(RH)

    # Pull RH account data
    accounts <- RobinHood::api_accounts(RH)

    return(accounts)

}

Try the RobinHood package in your browser

Any scripts or data that you put into this service are public.

RobinHood documentation built on Jan. 7, 2023, 1:11 a.m.