R/aidsSystem.R

.aidsSystem <- function( nGoods, nShifter = 0, LA = TRUE ) {
  if( LA ) {
    system <- list()
    for(i in 1:( nGoods - 1 ) ) {
      system[[ i ]] <- paste( "w", as.character( i ), " ~ lxtr", sep = "" )
      for( j in 1:nGoods ) {
        system[[ i ]] <- paste( system[[ i ]], " + lp",
           as.character( j ), sep = "" )
      }
      if( nShifter > 0 ) {
         for( j in 1:nShifter ) {
            system[[ i ]] <- paste( system[[ i ]], " + s",
               as.character( j ), sep = "" )
         }
      }
      system[[ i ]] <- as.formula( system[[ i ]] )
    }
  }
  return( system )
}

Try the micEconAids package in your browser

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

micEconAids documentation built on May 2, 2019, 5:21 p.m.