Thank you for using Just Answer.
Any ordinary and necessary expenses incurred in the production of income are deductible against the income. However, normally capital assets and improvements normally are not "expensed" but are depreciated over the life of the asset. This means that you can deduct a portion of the cost each year. According to IRS regulations, a pig used for breeding should be depreciated over 3 years. Sheep, goats, and cattle are depreciated over 5 years. Chickens can be expensed in the year of purchase.
There is also an option in section 179 of the IRS code, in which you may be able to totally expense an asset in the year placed in service. But there are some limitations to this option. For example, there is a "business income" limitation that you may not qualify since you are retired.
BotXXXXX XXXXXne is that as long as you are using the animals, corrals, pens, etc. in the production of income, you will be able to deduct the entire cost at some point in time. The only question is whether or not you deduct those costs in the year of purchase or whether you deduct some each year for the next few years.