The import code's list comprehension is incorrect. I would fix it but I don't see it thumbing though the code. Kinda new to the site. In fact, I'm kinda new to programming and I came here for a project, so I think its critical the intro guide should be corrected. hence the post.
names_to_install = [x for packnames if not rpackages.isinstalled(x)]
names_to_install = [x for x in packnames if not rpackages.isinstalled(x)]