R/check_data.R

Defines functions check_data

##############################################################################################
## check if input data is in appropiate format and column for abnormal return series exists  #
## Dependencies: none                                                                        #
## as of September 28, 2018 (by Siegfried Köstlmeier, University of Regensburg, Germany)     #
## Disclaimer: Absolutely no warranty.                                                       #
##############################################################################################

check_data <- function(data, abnr) {
      if(is(data,"data.frame")){
        if(is.null(data[,abnr])){
          stop("Column for abnormal return series could not be found")
        }else{
          return(data)
        }
      }else{
        stop("Input class must be 'data.frame'")
      }


}

Try the crseEventStudy package in your browser

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

crseEventStudy documentation built on March 18, 2022, 7:20 p.m.