It is normal to have errors when working with R and R markdown. Problems can be minimised by developing the document and code incrementally and knitting it repeatedly so that errors can be detected immediately.
Here are some common problems.
Chunk names must be unique. If they are not you will get an error message including the following
Duplicate chunk label 'import', which has been used for the chunk:
Identify the offending chunk and rename it.