I'm making sweet potato cornbread and the recipe calls for a cast iron pan to be use. What is a good alternative to it? Could I use a thin metal pan?
Hi Lisa and welcome to Seasoned Advice! What you don't want is a thin pan. You will run the risk of burning, especially on the bottom. But it's not all bad news.
Cast iron is thick and while it will take longer to heat up than a thin pan, it will provide a more even heat.
Another thing to consider is that a dark pan usually cooks a little quicker (sometimes compensated with a slightly lower temperature) and helps with browning.
One alternative would be a thick aluminum pan. I have a couple and use them interchangeably with cast iron for baking. If you have one, you might need to slightly raise your temperature as this is not a dark pan.
If all you have is a thin pan, I would suggest moving the oven rack up one notch and slightly lowering your temperature, perhaps 25° (F). With the other factors in consideration you will need to check it more often and watch your time, but you can make it work.
A recipe calling for a cast iron pan is likely going to rely on the properties of that pan, to make the recipe work as it should. That doesn't mean you can't make it without the proper pan - if thin metal is all you have, you can work around it - it just means it will take some other shenanigans to make the recipe work instead.
So, first - if you don't have a cast iron pan, I would roughly guess a ceramic one is probably the next closest alternative, followed by sturdy glass (like a casserole dish) especially if it's dark in color, and then a sturdy metal pan (especially a dark one) and then a thin metal pan is last in the similarity chain. Cast iron is slow to heat up, and slow to cool down - so one similarity would be the amount of thermal mass the pan has (thick sturdy pans at the top of the list, thinner at the bottom), another would be how well it absorbs and transmits heat (darker pans absorb heat better), and another layer of similarity is how the pan is treated in the recipe (things like preheating).
Anyway, given one of the major properties of cast iron is its slow to heat and cool I would compensate for that, when using a thin metal pan, primarily by playing around with the oven heat. Since you don't have the recipe added, I'm going to be offering a couple options based on possibilities - up to you which fits your situation best.
If the cast iron was supposed to be preheated, then the real difference would be that the bread would continue to cook after being taken out of the oven. I would turn off the heat at the time the recipe cites, and let it sit in the still hot but off oven for a few minutes (about as long as it would be expected to sit between finishing baking and being served). If the pan is already hot, there's very little difference in the process of heating up the bread while baking - a thin pan will heat nearly as quickly as the dough plopped into a hot pan, although that "nearly' should be covered by letting it rest in the hot oven after it's off.
If the pan wasn't preheated, then you have an additional effect where the pan would end up keep the bread slightly cooler while the pan was absorbing heat, then have it continue cooking longer after it has been pulled out of the oven. In this case, you should probably bake your bread at a slightly cooler temperature (like 300F instead of 350F, or something like that), for just a little bit longer (maybe ten or fifteen minutes) - though you will want to be checking very carefully. You should still turn off the oven and let it finish in the residual heat, this will also help prevent the outside being overly browned while the inside is underdone and simulate the bread finishing its cooking in the heat from the cast iron.
With all of this tweaking and adjusting the temp and conditions, don't rely on the recipe's timing - check for doneness with a toothpick test, or poking to test resilience, or whatever test the recipe uses (or other cornbread recipes use) to know when it's fully cooked. And keep a close eye on the browning - turn down the heating element sharply, or if nearly done turn it off and let it coast the rest of the way, if it's browning too quickly, or turn it on broil for a few minutes if it isn't browning enough but the inside's done. I will admit my time adjustments are just guesstimates, it will depend on how high the temperature is in the recipe, and how long the baking is supposed to be - but the point is a slight but noticeable change, so the inside bakes a bit more and the outside a bit less, to "undo" the recipe's adjusting for cast iron. If the baking time was very long, then perhaps you should raise the temperature to the recipe's amount after fifteen minutes or so (as I'd guess the cast iron would have begun to heat by then).
Also, you might want to use a baking stone or other thermal mass in the oven to help the heat to stay even, If you have them. It isn't required, ovens do maintain temperature on their own, but it might help the bread cook evenly. If you happen to have a small mass (like pan-sized, maybe some tiles or so), you can pop it in the oven with your bread to accurately mimic the effect of the cast iron on the oven's heat - but otherwise you should be putting it into the oven from the beginning, and giving extra time to preheat (half hour or more extra) to bring it up to heat.
If you have a thick carbon steel pan, this can be a good substitute for cast iron. They are nearly as non-stick when properly seasoned and they are a lot less heavy and less prone to thermal shock as well. You will still need to preheat them before using and also use a bit of oil or other lubricant, just like the cast iron. Hope this helps.