Problem using Lintr in R

This is probably something asinine, but I don’t think I configured it correctly lintrin Rstudio (0.99.486). I have all the settings in the "Settings"> "Code"> "Diagnostics" section and have been lintruploaded to the project workspace. However, when I run the diagnostics, I get no errors in syntax, assignment, etc. Is there something I need to do to enable all liters by default?

(Please forbid me from any stupid mistake I have made so far.)

# Sample code; only warnings are for unknown symbol, unexpected
# tokens, and missing whitespace around binary operator
testing = function(test1, test2)
{
  return paste(test, test1)
}
test.var = 1+2
+4
source share
2 answers

I think RStudio diagnostics have nothing to do with lintr.

to run lint("your-file-to-test.R") (or other lints) from the console.

RStudio ( ), "" , .

, . . ( , , , ).

+1

" " - R. , , :

> lint('test4.r')
test4.r:3:9: style: Use <-, not =, for assignment.
testing = function(test1, test2)
        ^
test4.r:5:10: error: unexpected symbol
  return paste(test, test1)
         ^
test4.r:8:1: style: Trailing blank lines are superfluous.
0

Source: https://habr.com/ru/post/1612301/


All Articles