R/distRayCheckData.R

Defines functions distRayCheckData

distRayCheckData <- function( xNames, yNames, zNames, sNames, data ) {
  
  #### check argument 'data' ####
  #### and give an informative error message if something is incorrect
  if( !inherits( data, "data.frame" ) ) {
    return( "argument 'data' must be a data.frame" )
  }
  allNames <- c( xNames, yNames, zNames, sNames )
  missingNames <- allNames[ !allNames %in% names( data ) ]
  if( length( missingNames ) > 0 ) {
    return( paste( "the data.frame defined by argument 'data' does not include",
      "the following variables:",
      paste( missingNames, collapse = ", " ) ) )
  }

  return( NULL )
}

Try the micEconDistRay package in your browser

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

micEconDistRay documentation built on May 31, 2023, 9:15 p.m.