The U.S. dollar held on to its gains after climbing higher in the wake of stronger-than-expected economic data, reversing a previous loss that had the buck trading at a nine-day low.

This move also led to some of its rivals to weaken, including the euro, which had already been knocked by eurozone inflation data that was cooler than expected.

Otherwise, commodity- and trade-linked currencies, including the antipodean dollars and the Canadian dollar, remained under pressure to the threat of trade wars with the U.S.

What are currencies doing?

The ICE U.S. Dollar Index DXY, -0.09% recovered to 90.256, up 0.1%. On the week, the index gain 0.1%, according to FactSet data, marking it its fourth weekly gain in a row. The broader WSJ U.S. Dollar BUXX, +0.01% gained 0.2% to 83.97, having risen 0.2% on the week.

The Japanese yen defended its gains against the dollar JPYUSD, 0.11 , with the buck buying ¥106.07, compared with ¥106.33 late Thursday in New York. Earlier, the pair hit a seven-day low. This week, the greenback fell 0.7% against the yen.

Read:Here’s what a scandal in Japan could mean for the yen

The euro EURUSD, -0.07% fetched $1.2285, compared with $1.2306 on Thursday, representing a weekly loss of 0.2%.

The British pound GBPUSD, -0.00% was little changed at $1.3942, versus $1.3936 on Thursday, having rallied 0.7% on the week.

Against the Canadian dollar USDCAD, +0.05% , the greenback jumped to C$1.3097—a fresh near nine-month high—up from C$1.3056 late Thursday. At a 2.2% drop this week, the Canadian dollar was the worst performer of this group.

Both the Australian and New Zealand dollar slipped against the buck, with the Aussie AUDUSD, -0.13% buying $0.7712 versus $0.7798, and the kiwi NZDUSD, +0.07% fetching $0.7210, down from $0.7276. On the week, the Aussie dollar dipped 1.7%, while the kiwi fell 1%.

See:How tariffs directed at China could ripple through emerging-market currencies

What drove the market?

The U.S. dollar recovered from a more than one-week low it had hit earlier in the session on the back of better-than-expected economic reports. February data for industrial production and capacity utilization, as well as March consumer sentiment, all beat consensus expectations, propelling the buck to retrace its losses and flip into positive territory.

Earlier, traders rushed into the relative safety of the yen after reports that President Donald Trump is planning to replace McMaster.

White House press secretary Sarah Huckabee Sanders dismissed that suggestion in a tweet late Thursday, but administration officials have reportedly confirmed it.

This added to uncertainty over the stability of the U.S. administration, analysts said, after a series of high-profile departures from the Trump administration and team. Secretary of State Rex Tillerson was fired earlier this week and is due to be replaced by CIA Director Mike Pompeo, while top White House economic adviser Gary Cohn resigned last week. On Friday, CBS News reported that the White House may also soon lose John Kelly as chief of staff.

In Europe, the euro pared its gain after official figures showed inflation in the eurozone fell to 1.1% in February. That was down from an initial estimate of 1.2% and lower than the 1.3% recorded in January. Weaker inflation could deter the European Central Bank from rolling back its aggressive quantitative-easing program later this year.

What are strategists saying?

“The dollar moved higher on some pretty solid data this morning, but overall it’s a bit mixed. There’s a pullback in trade-sensitive currencies, and on the flip side the yen is outperforming” said Omer Esiner, chief market analyst at Commonwealth FX.

“The yen, which tends to benefit at times of uncertainty, was on the rise on the back of U.S. political developments,” said Marios Hadjikyriacos, investment analyst a foreign-exchange broker XM, adding that the reports pertaining to McMasters ousting, despite being refuted later, added to the narrative that “things are not working smoothly in the administration.”

“I think the slightly cautious tone from the ECB last week and [ECB president] Mario Draghi earlier this week, isn’t totally reflected in the euro,” Esiner added, saying the euro-dollar pair was worth keeping an eye on in this respect.

What else is on the agenda for Friday?

February housing starts came in at 1.236 million, below the consensus estimate of 1.290 million, while building permits fell to 1.298 million from 1.377 million before.

Industrial production jumped 1.1% in February, outperforming the expectation of 0.5%, and reversing from a previous contraction. Capacity utilization in the same month read 78.1%, compared with 77.8% forecast.

March consumer sentiment rose to 102, versus 99.5 expected.

Finally, January job openings read 6.3 million, up from 5.7 million previously, concluding Friday’s major data releases.