No! They are not! A common fallacy I read sometimes is people arguing that since they farmed part of whatever it is they're selling, it's cheaper for them to make than it is for me to make. This is, quite simply, not true. It's easy to see where the error comes from, but much harder to win an argument about it.
Opportunity costIf you farm herbs, you mill them, create inks, and then use those to make armor vellum, those vellums are not free, nor are they the cost of the vendor paper. The farmed materials can be sold a certain amount, and many people neglect to factor this. Farming feels like getting something for free -- after all, you're playing a game, and then when you finish playing, you have goods you didn't have before.
Opportunity cost is, simply, what something would have been worth had you done something differently. The opportunity cost of going to law school is not the tuition, but the money you would have made had you not been studying law. Add that to the direct cost (tuition, books, bribes, what have you), and you get the total cost. Compare this to the profits at the end of the run to determine whether it's worth it.