Although R allows missing argument in the following forms:
fun(x =)
fun(x=1,,2)
fun(1,)
such examples are almost always not intended in practice. For example, when editing the following list:
x <- list(
a = 1,
b = 2,
c = 3
)
Removing c only will result in the following:
x <- list(
a = 1,
b = 2,
)
This is syntactically correct but will produce error at runtime.
A missing function argument linter will be useful to detect all these cases where (,, ,,, ,) or =) appear.
For matrix/array or data frame subsetting like mat[1,], arr[,1,2], df[, "col"], since using [ is not parsed as SYMBOL_FUNCTION_CALL, then the linter would by default not complain such usage.
Although R allows missing argument in the following forms:
such examples are almost always not intended in practice. For example, when editing the following list:
Removing
conly will result in the following:This is syntactically correct but will produce error at runtime.
A missing function argument linter will be useful to detect all these cases where
(,,,,,,)or=)appear.For matrix/array or data frame subsetting like
mat[1,],arr[,1,2],df[, "col"], since using[is not parsed asSYMBOL_FUNCTION_CALL, then the linter would by default not complain such usage.