David Carr, the iconoclastic media columnist for the New York Times, died Thursday while working at the Times’ office. He was 58.

Autopsy results released on Saturday showed that Carr died of complications from lung cancer. According to the office of the chief medical examiner of New York City, heart disease was a contributing factor as well.

Mr. Carr, 58, had been a survivor of Hodgkin’s lymphoma, a cancer of the lymphatic system, and described his experiences as a cancer patient in his 2008 memoir, “The Night of the Gun.”

The New York Times reported that he collapsed in The Times newsroom, where he was found shortly before 9 p.m. EST. He was taken to St. Luke’s-Roosevelt Hospital, where he was pronounced dead, according to the Times.

Earlier in the evening, he moderated a panel discussion about the film “Citizenfour” with its principal subject, Edward J. Snowden; the film’s director, Laura Poitras; and Glenn Greenwald, a journalist.

Carr wrote the Media Equation column for the Times’ Business section. He was also known to showbiz figures from his stint several years ago as the Times’ awards-season correspondent for the Carpetbagger blog.

Carr was prominently featured in the 2011 docu “Page One: Inside the New York Times.” He joined the Times in 2002. Before that, he was a contributing writer to the Atlantic Monthly and New York magazine. In the mid-1990s he was editor of Washington, D.C.’s City Paper.

Carr was candid about his past battles with drug addiction. In 2008, he published the nonfiction book “Night of the Gun,” which revisited his experiences as a drug abuser and used traditional reporting techniques to fill in gaps and misperceptions from his own memory. He went back to his hometown of Minneapolis and interviewed ex-girlfriends, cops and fellow companions, and posted interviews and documents on a website for the project, Nightofthegun.com.

His greatest influence was via his weekly column, in which he paid particular attention to the disruption of traditional media and the struggles to make a business model out of digital platforms.

“His plainspoken style was sometimes blunt, and searingly honest about himself,” the Times said in its story. “The effect was both folksy and sophisticated, a voice from a shrewd and well-informed skeptic.”

On Monday, he wrote about the revelations that the NBC anchor Brian Williams had lied about being in a helicopter under fire in Iraq in 2003. “We want our anchors to be both good at reading the news and also pretending to be in the middle of it,” he wrote. His final column, which ran on Wednesday, was tied to NBC’s suspension from the newscast and Jon Stewart’s decision to retire from “The Daily Show.”

Carr’s survivors include his wife, Jill Rooney Carr, and three daughters.