The retailing world offers some attractive choices for investors right now. Big players have shown recently that they can boost customer traffic even as their businesses shift toward e-commerce. The profit pinch from that digital build-out, meanwhile, has depressed stock valuations while keeping dividend yields high.

So let's compare two giants of retail, Walmart (NYSE:WMT) and Lowe's (NYSE:LOW), to see which one might make a better buy for investors today.

Here are a few key statistics to get us started:

Stock metrics: Walmart and Lowe's

Metric

Walmart

Lowe's

Market cap

$244 billion

$80 billion

Sales growth

2.2%

4%

Net profit margin

2%

5%

Dividend yield

2.5%

2%

Return on invested capital

14%

19%

P/E ratio

17

18

Sales growth is for the past complete fiscal year and excludes fuel sales and exchange rate changes. Data sources: Company financial filings.

Growth and profits

Neither company would be a prime choice for investors seeking market-leading sales and profit growth. In Lowe's case, its 4% sales expansion last year was far behind peer Home Depot and its 7.2% spike. Lowe's also trails its bigger rival in operating margin, 9% of sales compared to 14%, and in return on invested capital, at 19% compared to 32%.

Walmart has also been putting up modest numbers recently, although its market-share position appears stronger than Lowe's. The retailing king's 2% sales-growth pace beats Kroger, is just slightly behind Target, and significantly trails Costco.

And while both companies are logging steady but modest customer traffic increases, Walmart has two additional sources of revenue that Lowe's lacks. It gets a significant chunk of business from international markets, and the retailer has built up a massive online selling infrastructure that recently crossed $11 billion in annual sales.

Returns and valuation

Walmart promises a higher dividend yield today, at 2.5% compared to Lowe's 2%. However, the outlook for long-term dividend growth is brighter with a Lowe's investment. The home-improvement retailer currently pays only about one-third of its earnings in dividend checks, which gives it plenty of room to expand toward the 55% that rival Home Depot promises its shareholders. Walmart has less flexibility here since its dividend is currently sitting at over two-thirds of earnings.

A customer selects a piece of lumber.

Image source: Getty Images.

Finally, Walmart's stock is valued at about 12 times the $20.4 billion of operating income it earned last year. Investors have assigned roughly the same valuation to Lowe's, which can be purchased for 12 times the $6.4 billion in operating profit it booked in 2017.

Stick with the market leader

So which one is the better deal?

If you're looking for long-term dividend appreciation at a reasonable price, then you might consider buying Lowe's stock. However, your investment will likely depend on how successfully the company's new CEO can close the performance gap with Home Depot in the years ahead.

For a safer all-around bet, I'd choose Walmart. It has a global revenue base that isn't tied to the health of just one industry. Its multichannel strategy, meanwhile, benefits from Walmart's unparalleled purchasing power that comes with its $500 billion annual sales base.

Rivals -- both online, and in physical locations -- aren't likely to find much success at chipping away at that dominant market position. Sure, Walmart should see its overall profitability slip as its sales mix shifts toward the e-commerce channel in the coming years. But Lowe's is facing that challenge, too, and the retailer's growth strategies are complicated by the fact that they must bump up against Home Depot at every turn.

Demitrios Kalogeropoulos owns shares of Costco Wholesale and Home Depot. The Motley Fool has the following options: short September 2018 $180 calls on Home Depot and long January 2020 $110 calls on Home Depot. The Motley Fool recommends Costco Wholesale and Home Depot. The Motley Fool has a disclosure policy.