The first appearance of a space-faring Robinson family was in an original science-fiction comic book series, Space Family Robinson, published by Gold Key Comics. Lost in space, they travelled the universe aboard Space Station One. The first issue was published in December 1962.
The TV show came three years later. The book Silver Age: The Second Generation of Comic Artists by Daniel Herman explains that when the Lost in Space TV series came out in 1965, it was obvious that it was inspired, at least in part, by the comic book, but CBS, the network airing the show, had never acquired the license from Western Publishing.(Both are loosely based on the novel and identically-named movies, Swiss Family Robinson.)
Rather than sue CBS or Irwin Allen, Western decided to reach a settlement that allowed them to use “Lost in Space” for the title of the comic book. Since CBS and Irwin Allen licensed shows to Western, Western didn’t want to antagonize them. Also the TV show title probably helped sales of the comic book. With issue #15 (January, 1966), the “Lost in Space” title was added to the cover.
After that, the TV series went ahead with stories separate from the comic book series. Space Family Robinson was published as a total of 59 issues, from 1962 to 1982.
Bottom photo: June Lockhart as Dr. Maureen Robinson (biochemist) on the set of Lost in Space. Her role in the series was mainly to prepare meals, tend the garden, and help with light construction while adding a voice of compassion. Her status as a doctor is mentioned only twice in the series. (Wikipedia)