R/CheckCred.R

CheckCred<- function(x= NULL){

# If LC_CRED is null, then a value was not passed in the calling
# function. If it isn't null, then return it.
if(!is.null(x)) {
    if (length(x) == 2)
        { return(x)
        } else {
        stop("Please create the credential object LC_CRED using the MakeCredential() function",
             call.= FALSE)
        }
    }

# If LC_CRED is null, then check if it exists in the global environment
if (!exists("LC_CRED", envir= .GlobalEnv)){
    stop("Please create the credential object LC_CRED using the MakeCredential() function",
         call.= FALSE)
    }
    
    get("LC_CRED")
}

Try the LendingClub package in your browser

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

LendingClub documentation built on May 1, 2019, 9:14 p.m.