.\" Man page generated from reStructuredText. . .TH CTAGS-LANG-R 7 "" "5.9.0" "Universal Ctags" .SH NAME ctags-lang-r \- Random notes about tagging R source code with Universal Ctags . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .nf \fBctags\fP ... \-\-languages=+R ... \fBctags\fP ... \-\-language\-force=R ... \fBctags\fP ... \-\-map\-Python=+.r ... .fi .sp .SH DESCRIPTION .sp This man page gathers random notes about tagging R source code with Universal Ctags. .SH KINDS .sp If a variable gets a value returned from a \fIwell\-known constructor\fP and the variable appears for the first time in the current input file, the R parser makes a tag for the variable and attaches a kind associated with the constructor to the tag regardless of whether the variable appears in the top\-level context or a function. .sp Well\-known constructor and kind mapping .INDENT 0.0 .INDENT 3.5 .TS center; |l|l|. _ T{ Constructor T} T{ kind T} _ T{ function() T} T{ function T} _ T{ c() T} T{ vector T} _ T{ list() T} T{ list T} _ T{ data.frame() T} T{ dataframe T} _ .TE .UNINDENT .UNINDENT .sp If a variable doesn\(aqt get a value returned from one of well\-known constructors, the R parser attaches \fBglobalVar\fP or \fBfunctionVar\fP kind to the tag for the variable depending on the context. .sp Here is an example demonstrating the usage of the kinds: .sp "input.r" .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C G <\- 1 v <\- c(1, 2) l <\- list(3, 4) d <\- data.frame(n = v) f <\- function(a) { g <\- function (b) a + b w <\- c(1, 2) m <\- list (3, 4) e <\- data.frame(n = w) L <\- 2 } .ft P .fi .UNINDENT .UNINDENT .sp "output.tags" with "\-\-options=NONE \-\-sort=no \-\-fields=+KZ \-o \- input.r" .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C G input.r /^G <\- 1$/;" globalVar v input.r /^v <\- c(1, 2)$/;" vector l input.r /^l <\- list(3, 4)$/;" list d input.r /^d <\- data.frame(n = v)$/;" dataframe n input.r /^d <\- data.frame(n = v)$/;" nameattr scope:dataframe:d f input.r /^f <\- function(a) {$/;" function g input.r /^ g <\- function (b) a + b$/;" function scope:function:f w input.r /^ w <\- c(1, 2)$/;" vector scope:function:f m input.r /^ m <\- list (3, 4)$/;" list scope:function:f e input.r /^ e <\- data.frame(n = w)$/;" dataframe scope:function:f n input.r /^ e <\- data.frame(n = w)$/;" nameattr scope:dataframe:f.e L input.r /^ L <\- 2$/;" functionVar scope:function:f .ft P .fi .UNINDENT .UNINDENT .\" TODO: .\" .\" - other kinds .\" - operators for assignment, <-, <<-, ->>, ->, = .\" - illuminating duplicated tags .\" - fields (constructor, assignmentop) .\" - sub parsers . .SH SEE ALSO .sp ctags(1) .\" Generated by docutils manpage writer. .