
NA
if the (last) instruction is incomplete.parseText(text, firstline = 1, srcfilename = NULL, encoding = "unknown")
1
, empty lines are added in front of text
in
order to match the correct position in the file.text
, as in parse
.NA
if the last
instruction is correct but incomplete, or an object of class'try-error' with
the error message if the code is incorrect.captureAll
, sourceClipboard
,
parse
parseText('1+1')
parseText('1+1; log(10)')
parseText(c('1+1', 'log(10)'))
## Incomplete instruction
parseText('log(')
## Incomplete strings
parseText('text <- "some string')
parseText("text <- 'some string")
## Incomplete names (don't write backtick quoted names on several lines!)
## ...but just in case
parseText('`myvar')
## Wrong instruction
parseText('log)')
}
keyword{ IO }
concept{ parsing expression, incomplete code }
Run the code above in your browser using DataLab