Sweet potatoes are not yams; Dioscorea is the genus of yams, one of which is pictured here. Sweet potatoes are Ipomea batatas in the morning glory family (dicots). Yams are monocots. Sweet potatoes are storage roots (although at the root-stem junction) and yams are modified stems (tubers). See the nodes (“eyes”)? What you get in North American markets are sweet potatoes, and yes, the larger, fleshier varieties are called “yams” but they aren’t yams. And those “candied” yams in cans are sweet potatoes too.
The discerning among you will have noticed that the native name for sweet potatoes "batatas" was preserved in the scientific name, and you guessed it, this common name was misapplied by Europeans to another plant native to the same region (Peruvian South America) Solanum tuberosa, the "potato", which is not Irish in the least.