Hmmmm, I Robot is a collection of short stories. The I robot film is loosely (if at all really) based around the first one "Robbie" which sort of looks at the whole Frankenstein Complex surrounding human-like robots. So not literally speaking destroying the plot.
I am Legend (the book) is about what it means to be human, Is the last "proper" human the remnants of a lost civilisation as the hero believes, or are the Vampires (for that's what they are in the book) now Humanity? Eventually the "hero" of the book is killed by pills given to him by a member of the new humanity, so…Plot fail.
HTH