Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any existing syntax checker for GNU R

Tags:

syntax

r

Is there any existing tool to perform the same function as 'jslint' or 'php -l'?

For a large scale project, how can we ensure source code without any typo error before any unit test.

like image 986
RobinMin Avatar asked Mar 15 '12 02:03

RobinMin


2 Answers

There is the codetools package (especially the checkUsage function) and the lint function in the svTools package.

like image 189
Brian Diggs Avatar answered Oct 07 '22 21:10

Brian Diggs


Yes I got the lintr checker from here to work:

https://www.r-project.org/nosvn/pandoc/lintr.html

https://github.com/jimhester/lintr

Installation for Vim:

Put the file syntastic/lintr.vim under the syntastic/syntax_checkers/r directory. If you are using pathogen this directory is ~/.vim/bundles/syntastic/syntax_checkers/r.

Then add the following lines to your .vimrc.

let g:syntastic_enable_r_lintr_checker = 1
let g:syntastic_r_checkers = ['lintr']

Start vim and it should work, here is mine:

enter image description here

like image 27
Eric Leschinski Avatar answered Oct 07 '22 22:10

Eric Leschinski