0

I am currently using R for my final thesis. I am using the frontier library to run my data base. When I tried to run R, it show me this error message " NA/NaN/Inf in foreign function call (arg 29)"

I realize the problem should be coming from the YEAR variable in my database. Any idea how to solve the problem? Thank you very much!

Code That I am using:

airlineCost <- sfa (log( airlinedb$Total.Cost ) ~ log( airlinedb$Price.of.Labor ) + log( airlinedb$Price.of.Capital )+ 
                      log( airlinedb$Price.of.Fuel) + log( airlinedb$RATK )+airlinedb$YEAR+airlinedb$Half.Year
                    + airlinedb$YEAR*log( airlinedb$Price.of.Capital)+airlinedb$YEAR*log( airlinedb$Price.of.Fuel)+airlinedb$YEAR*log( airlinedb$Price.of.Labor)+airlinedb$YEAR*log( airlinedb$RATK)
                    + airlinedb$Half.P.Fuel +airlinedb$Price.of.Labor +airlinedb$half.p.cap+airlinedb$half.RATK+
                    log(airlinedb$Price.of.Labor)*log(airlinedb$Price.of.Capital)+log(airlinedb$Price.of.Capital)*log(airlinedb$Price.of.Fuel)+log(airlinedb$Price.of.Labor)*log(airlinedb$Price.of.Fuel)
                    +log(airlinedb$RATK)*log(airlinedb$Price.of.Fuel)+log(airlinedb$RATK)*log(airlinedb$Price.of.Labor)+log(airlinedb$RATK)*log(airlinedb$Price.of.Capital), data=airlinedb, ineffDecrease = FALSE, truncNorm = FALSE, timeEffect = FALSE) 
summary(airlineCost)

The following is the link to a small sample of data https://drive.google.com/file/d/0B52JA3mxOm9DQlNyMWU4SW1qbnM/view?usp=sharing

mikhail-t
  • 4,103
  • 7
  • 36
  • 56
  • Can you post a code example with sample data? – branch.lizard Jul 10 '15 at 21:32
  • 1
    Please provide a minimal [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610) with sample input and the code you are using. – MrFlick Jul 10 '15 at 21:33
  • I updated my post with the code i am using, but I could not attach the data which i am using since i do not have enough reputation to post photo. If I copy and paste the data set would be very messy. Sorry about that – Jeffrey Lam Jul 10 '15 at 21:41
  • Please also format your code sample to be readable (e.g. add nice formatting, line breaks etc.), people will be more inclined answering your question. – mikhail-t Jul 10 '15 at 21:56
  • You don't need all these `airlinedb$`. –  Jul 11 '15 at 00:23
  • solved thanks everyone! – Jeffrey Lam Jul 11 '15 at 10:30

0 Answers0