If there are roxygen2-type comments (preceded by #') and these are part of a selection being sent to the R console, there will be an error. E.g., if you have
MyFunction = function(x)
{
print(x)
}
#' Another function.
AnotherFunction = function(x)
{
print(x)
}
and you visually select the two functions and send to the R session, I get Error: unexpected symbol in " Another function.".