give error message when there are no PDFs or HTMLs in a directory, updated NAMESPACE, updated legend plot