~hrbrmstr/cloc

cloc/docs/index.html -rw-r--r-- 33.7 KiB
0350958fhrbrmstr Working on #10 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Count Lines of Code, Comments and Whitespace in Source Files and Archives • cloc</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Count Lines of Code, Comments and Whitespace in Source Files and Archives">
<meta property="og:description" content="Counts blank lines, comment lines, and physical lines of source code 
    in source files/trees/archives. An R wrapper to the 'Perl' command-line utility 
    &lt;https://github.com/AlDanial/cloc&gt;.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
    <div class="container template-article">
      <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="index.html">cloc</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.3.0</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
<li>
  <a href="index.html">
    <span class="fa fa-home fa-lg"></span>
     
  </a>
</li>
<li>
  <a href="reference/index.html">Reference</a>
</li>
<li>
  <a href="news/index.html">Changelog</a>
</li>
      </ul>
<ul class="nav navbar-nav navbar-right"></ul>
</div>
<!--/.nav-collapse -->
  </div>
<!--/.container -->
</div>
<!--/.navbar -->

      
      </header><div class="row">
  <div class="col-md-9 contents">
    

    
    
<!-- README.md is generated from README.Rmd. Please edit that file -->

<div id="cloc" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#cloc" class="anchor"></a>cloc</h1></div>
<p>Count Lines of Code, Comments and Whitespace in Source Files and Archives</p>
<div id="description" class="section level2">
<h2 class="hasAnchor">
<a href="#description" class="anchor"></a>Description</h2>
<p>Counts blank lines, comment lines, and physical lines of source code in source files/trees/archives. An R wrapper to the Perl <code>cloc</code> utility <a href="https://github.com/AlDanial/cloc" class="uri">https://github.com/AlDanial/cloc</a> by <span class="citation">@AlDanial</span>.</p>
</div>
<div id="whats-inside-the-tin" class="section level2">
<h2 class="hasAnchor">
<a href="#whats-inside-the-tin" class="anchor"></a>What’s Inside The Tin</h2>
<p>The following functions are implemented:</p>
<ul>
<li>
<code>cloc</code>: Count lines of code, comments and whitespace in source files/archives</li>
<li>
<code>cloc_by_file</code>: Count lines of code, comments and whitespace in source files/archives by file</li>
<li>
<code>cloc_cran</code>: Count lines of code (etc) from source packages on CRAN</li>
<li>
<code>cloc_git</code>: Count lines of code, comments and whitespace in a git tree</li>
<li>
<code>cloc_remove_comments</code>: Strip comments and white space from a single source file</li>
<li>
<code>cloc_recognized_languages</code>: Return a data frame of ‘cloc’ recognized languages and associated extensions</li>
<li>
<code>cloc_call</code>: Call ‘cloc.pl’ directly with granular control over options</li>
<li>
<code>clock_pkg_md</code> : Run <code><a href="reference/cloc_pkg.html">cloc_pkg()</a></code> on active package and format it as a markdown table for knitting into reports</li>
<li>
<code>cloc_help</code>: See the command-line help</li>
<li>
<code>cloc_version</code>: Retrieve the version of the embedded perl script</li>
<li>
<code>cloc_os</code>: Ask the embedded perl script to detect the OS type</li>
</ul>
</div>
<div id="usage" class="section level2">
<h2 class="hasAnchor">
<a href="#usage" class="anchor"></a>Usage</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1">devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_github</a></span>(<span class="st">"hrbrmstr/cloc"</span>)</a></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(cloc)</a>
<a class="sourceLine" id="cb2-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(tibble)</a>
<a class="sourceLine" id="cb2-3" title="3"></a>
<a class="sourceLine" id="cb2-4" title="4"><span class="co"># current verison</span></a>
<a class="sourceLine" id="cb2-5" title="5"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/packageDescription">packageVersion</a></span>(<span class="st">"cloc"</span>)</a>
<a class="sourceLine" id="cb2-6" title="6"><span class="co">#&gt; [1] '0.3.0'</span></a></code></pre></div>
<p>Basic usage</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1"><span class="co"># by dir</span></a>
<a class="sourceLine" id="cb3-2" title="2"><span class="kw"><a href="reference/cloc.html">cloc</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/system.file">system.file</a></span>(<span class="st">"extdata"</span>, <span class="dt">package=</span><span class="st">"cloc"</span>))</a>
<a class="sourceLine" id="cb3-3" title="3"><span class="co">#&gt; # A tibble: 2 x 10</span></a>
<a class="sourceLine" id="cb3-4" title="4"><span class="co">#&gt;   source  language file_count file_count_pct   loc loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb3-5" title="5"><span class="co">#&gt;   &lt;chr&gt;   &lt;chr&gt;         &lt;int&gt;          &lt;dbl&gt; &lt;int&gt;   &lt;dbl&gt;       &lt;int&gt;          &lt;dbl&gt;         &lt;int&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb3-6" title="6"><span class="co">#&gt; 1 extdata C++               1            0.5   142   0.507          41          0.631            63            0.470</span></a>
<a class="sourceLine" id="cb3-7" title="7"><span class="co">#&gt; 2 extdata R                 1            0.5   138   0.493          24          0.369            71            0.530</span></a>
<a class="sourceLine" id="cb3-8" title="8"></a>
<a class="sourceLine" id="cb3-9" title="9"><span class="co"># by file</span></a>
<a class="sourceLine" id="cb3-10" title="10"><span class="kw"><a href="reference/cloc.html">cloc</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/system.file">system.file</a></span>(<span class="st">"extdata"</span>, <span class="st">"qrencoder.cpp"</span>, <span class="dt">package=</span><span class="st">"cloc"</span>))</a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; # A tibble: 1 x 10</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt;   source      language file_count file_count_pct   loc loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt;   &lt;chr&gt;       &lt;chr&gt;         &lt;int&gt;          &lt;dbl&gt; &lt;int&gt;   &lt;dbl&gt;       &lt;int&gt;          &lt;dbl&gt;         &lt;int&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; 1 qrencoder.… C++               1              1   142       1          41              1            63                1</span></a>
<a class="sourceLine" id="cb3-15" title="15"></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co"># from a url</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="kw"><a href="reference/cloc.html">cloc</a></span>(<span class="st">"https://rud.is/dl/cloc-1.74.tar.gz"</span>)</a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">#&gt; # A tibble: 93 x 10</span></a>
<a class="sourceLine" id="cb3-19" title="19"><span class="co">#&gt;    source    language  file_count file_count_pct   loc loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="co">#&gt;    &lt;chr&gt;     &lt;chr&gt;          &lt;int&gt;          &lt;dbl&gt; &lt;int&gt;   &lt;dbl&gt;       &lt;int&gt;          &lt;dbl&gt;         &lt;int&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb3-21" title="21"><span class="co">#&gt;  1 cloc-1.7… Perl               5        0.0180  19712  0.598         1353       0.420             2430          0.443  </span></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">#&gt;  2 cloc-1.7… YAML             141        0.507    2887  0.0876           1       0.000311           141          0.0257 </span></a>
<a class="sourceLine" id="cb3-23" title="23"><span class="co">#&gt;  3 cloc-1.7… Markdown           1        0.00360  2195  0.0666         226       0.0702              26          0.00474</span></a>
<a class="sourceLine" id="cb3-24" title="24"><span class="co">#&gt;  4 cloc-1.7… ANTLR Gr…          2        0.00719  1012  0.0307         200       0.0621              59          0.0108 </span></a>
<a class="sourceLine" id="cb3-25" title="25"><span class="co">#&gt;  5 cloc-1.7… R                  3        0.0108    698  0.0212          95       0.0295             312          0.0569 </span></a>
<a class="sourceLine" id="cb3-26" title="26"><span class="co">#&gt;  6 cloc-1.7… C/C++ He…          1        0.00360   617  0.0187         191       0.0593             780          0.142  </span></a>
<a class="sourceLine" id="cb3-27" title="27"><span class="co">#&gt;  7 cloc-1.7… C++                4        0.0144    570  0.0173         132       0.0410             173          0.0315 </span></a>
<a class="sourceLine" id="cb3-28" title="28"><span class="co">#&gt;  8 cloc-1.7… Forth              2        0.00719   529  0.0160          17       0.00528             84          0.0153 </span></a>
<a class="sourceLine" id="cb3-29" title="29"><span class="co">#&gt;  9 cloc-1.7… TypeScri…          3        0.0108    410  0.0124          52       0.0162              39          0.00711</span></a>
<a class="sourceLine" id="cb3-30" title="30"><span class="co">#&gt; 10 cloc-1.7… Logtalk            1        0.00360   368  0.0112          59       0.0183              57          0.0104 </span></a>
<a class="sourceLine" id="cb3-31" title="31"><span class="co">#&gt; # … with 83 more rows</span></a></code></pre></div>
<p>Custom CRAN package counter:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="reference/cloc_cran.html">cloc_cran</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"archdata"</span>, <span class="st">"hrbrthemes"</span>, <span class="st">"iptools"</span>, <span class="st">"dplyr"</span>))</a>
<a class="sourceLine" id="cb4-2" title="2"><span class="co">#&gt; # A tibble: 19 x 11</span></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="co">#&gt;    source language file_count file_count_pct   loc loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb4-4" title="4"><span class="co">#&gt;    &lt;chr&gt;  &lt;chr&gt;         &lt;dbl&gt;          &lt;dbl&gt; &lt;dbl&gt;   &lt;dbl&gt;       &lt;dbl&gt;          &lt;dbl&gt;         &lt;dbl&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb4-5" title="5"><span class="co">#&gt;  1 archd… &lt;NA&gt;              0        0           0 0.                0       0                    0         0       </span></a>
<a class="sourceLine" id="cb4-6" title="6"><span class="co">#&gt;  2 hrbrt… R                21        0.7      1094 6.63e-1         215       0.560              584         0.832   </span></a>
<a class="sourceLine" id="cb4-7" title="7"><span class="co">#&gt;  3 hrbrt… HTML              2        0.0667    366 2.22e-1          48       0.125                2         0.00285 </span></a>
<a class="sourceLine" id="cb4-8" title="8"><span class="co">#&gt;  4 hrbrt… CSS               1        0.0333    113 6.85e-2          27       0.0703               0         0       </span></a>
<a class="sourceLine" id="cb4-9" title="9"><span class="co">#&gt;  5 hrbrt… Rmd               3        0.1        35 2.12e-2          78       0.203              116         0.165   </span></a>
<a class="sourceLine" id="cb4-10" title="10"><span class="co">#&gt;  6 hrbrt… Markdown          1        0.0333     33 2.00e-2          16       0.0417               0         0       </span></a>
<a class="sourceLine" id="cb4-11" title="11"><span class="co">#&gt;  7 hrbrt… YAML              2        0.0667      8 4.85e-3           0       0                    0         0       </span></a>
<a class="sourceLine" id="cb4-12" title="12"><span class="co">#&gt;  8 iptoo… C++               4        0.138     846 4.21e-1         167       0.400              375         0.286   </span></a>
<a class="sourceLine" id="cb4-13" title="13"><span class="co">#&gt;  9 iptoo… HTML              2        0.0690    633 3.15e-1          54       0.129                2         0.00153 </span></a>
<a class="sourceLine" id="cb4-14" title="14"><span class="co">#&gt; 10 iptoo… R                20        0.690     444 2.21e-1         133       0.319              638         0.487   </span></a>
<a class="sourceLine" id="cb4-15" title="15"><span class="co">#&gt; 11 iptoo… Rmd               2        0.0690     48 2.39e-2          33       0.0791              72         0.0550  </span></a>
<a class="sourceLine" id="cb4-16" title="16"><span class="co">#&gt; 12 iptoo… C/C++ H…          1        0.0345     37 1.84e-2          30       0.0719             223         0.170   </span></a>
<a class="sourceLine" id="cb4-17" title="17"><span class="co">#&gt; 13 dplyr… R               171        0.552   14999 4.76e-1        3127       0.425             4957         0.685   </span></a>
<a class="sourceLine" id="cb4-18" title="18"><span class="co">#&gt; 14 dplyr… C/C++ H…        101        0.326    6661 2.11e-1        1754       0.238              483         0.0668  </span></a>
<a class="sourceLine" id="cb4-19" title="19"><span class="co">#&gt; 15 dplyr… C++              23        0.0742   4706 1.49e-1         954       0.130              437         0.0604  </span></a>
<a class="sourceLine" id="cb4-20" title="20"><span class="co">#&gt; 16 dplyr… HTML              5        0.0161   3206 1.02e-1         140       0.0190               5         0.000691</span></a>
<a class="sourceLine" id="cb4-21" title="21"><span class="co">#&gt; 17 dplyr… Markdown          2        0.00645  1479 4.69e-2         708       0.0962               0         0       </span></a>
<a class="sourceLine" id="cb4-22" title="22"><span class="co">#&gt; 18 dplyr… Rmd               7        0.0226    462 1.46e-2         667       0.0907            1350         0.187   </span></a>
<a class="sourceLine" id="cb4-23" title="23"><span class="co">#&gt; 19 dplyr… C                 1        0.00323    30 9.51e-4           7       0.000951             0         0       </span></a>
<a class="sourceLine" id="cb4-24" title="24"><span class="co">#&gt; # … with 1 more variable: pkg &lt;chr&gt;</span></a></code></pre></div>
<p>git tree</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="reference/cloc_git.html">cloc_git</a></span>(<span class="st">"~/packages/cloc"</span>)</a>
<a class="sourceLine" id="cb5-2" title="2"><span class="co">#&gt; # A tibble: 10 x 10</span></a>
<a class="sourceLine" id="cb5-3" title="3"><span class="co">#&gt;    source language   file_count file_count_pct   loc  loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb5-4" title="4"><span class="co">#&gt;    &lt;chr&gt;  &lt;chr&gt;           &lt;int&gt;          &lt;dbl&gt; &lt;int&gt;    &lt;dbl&gt;       &lt;int&gt;          &lt;dbl&gt;         &lt;int&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb5-5" title="5"><span class="co">#&gt;  1 cloc   Perl                1         0.0256 11153 0.863            835         0.592           1291          0.690  </span></a>
<a class="sourceLine" id="cb5-6" title="6"><span class="co">#&gt;  2 cloc   R                  17         0.436    622 0.0481           207         0.147            360          0.192  </span></a>
<a class="sourceLine" id="cb5-7" title="7"><span class="co">#&gt;  3 cloc   CSS                 2         0.0513   282 0.0218            71         0.0504            31          0.0166 </span></a>
<a class="sourceLine" id="cb5-8" title="8"><span class="co">#&gt;  4 cloc   Markdown            4         0.103    265 0.0205            57         0.0404             0          0      </span></a>
<a class="sourceLine" id="cb5-9" title="9"><span class="co">#&gt;  5 cloc   HTML                3         0.0769   251 0.0194           106         0.0752            36          0.0192 </span></a>
<a class="sourceLine" id="cb5-10" title="10"><span class="co">#&gt;  6 cloc   JavaScript          2         0.0513   144 0.0111            40         0.0284            16          0.00855</span></a>
<a class="sourceLine" id="cb5-11" title="11"><span class="co">#&gt;  7 cloc   C++                 1         0.0256   142 0.0110            41         0.0291            63          0.0337 </span></a>
<a class="sourceLine" id="cb5-12" title="12"><span class="co">#&gt;  8 cloc   YAML                4         0.103     39 0.00302           15         0.0106             3          0.00160</span></a>
<a class="sourceLine" id="cb5-13" title="13"><span class="co">#&gt;  9 cloc   Rmd                 1         0.0256    24 0.00186           38         0.0270            71          0.0379 </span></a>
<a class="sourceLine" id="cb5-14" title="14"><span class="co">#&gt; 10 cloc   JSON                4         0.103      4 0.000309           0         0                  0          0</span></a></code></pre></div>
<p>git tree (with specific commit)</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="reference/cloc_git.html">cloc_git</a></span>(<span class="st">"~/packages/cloc"</span>, <span class="st">"3643cd09d4b951b1b35d32dffe35985dfe7756c4"</span>)</a>
<a class="sourceLine" id="cb6-2" title="2"><span class="co">#&gt; # A tibble: 5 x 10</span></a>
<a class="sourceLine" id="cb6-3" title="3"><span class="co">#&gt;   source language file_count file_count_pct   loc  loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="co">#&gt;   &lt;chr&gt;  &lt;chr&gt;         &lt;int&gt;          &lt;dbl&gt; &lt;int&gt;    &lt;dbl&gt;       &lt;int&gt;          &lt;dbl&gt;         &lt;int&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb6-5" title="5"><span class="co">#&gt; 1 cloc   Perl              1          0.111 10059 0.987            787        0.911            1292         0.957   </span></a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co">#&gt; 2 cloc   Markdown          2          0.222    60 0.00589           31        0.0359              0         0       </span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#&gt; 3 cloc   R                 4          0.444    52 0.00510           22        0.0255             25         0.0185  </span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#&gt; 4 cloc   Rmd               1          0.111    13 0.00128           21        0.0243             32         0.0237  </span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; 5 cloc   YAML              1          0.111    10 0.000981           3        0.00347             1         0.000741</span></a></code></pre></div>
<p>remote git tree</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1"><span class="kw"><a href="reference/cloc_git.html">cloc_git</a></span>(<span class="st">"git://github.com/maelle/convertagd.git"</span>)</a>
<a class="sourceLine" id="cb7-2" title="2"><span class="co">#&gt; # A tibble: 4 x 10</span></a>
<a class="sourceLine" id="cb7-3" title="3"><span class="co">#&gt;   source      language file_count file_count_pct   loc loc_pct blank_lines blank_line_pct comment_lines comment_line_pct</span></a>
<a class="sourceLine" id="cb7-4" title="4"><span class="co">#&gt;   &lt;chr&gt;       &lt;chr&gt;         &lt;int&gt;          &lt;dbl&gt; &lt;int&gt;   &lt;dbl&gt;       &lt;int&gt;          &lt;dbl&gt;         &lt;int&gt;            &lt;dbl&gt;</span></a>
<a class="sourceLine" id="cb7-5" title="5"><span class="co">#&gt; 1 convertagd… R                 7         0.583    249  0.659           70          0.56             68           0.667 </span></a>
<a class="sourceLine" id="cb7-6" title="6"><span class="co">#&gt; 2 convertagd… Markdown          2         0.167     77  0.204           23          0.184             0           0     </span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#&gt; 3 convertagd… YAML              2         0.167     42  0.111           16          0.128             4           0.0392</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#&gt; 4 convertagd… Rmd               1         0.0833    10  0.0265          16          0.128            30           0.294</span></a></code></pre></div>
<p>Detailed results by file</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="co"># whole dir</span></a>
<a class="sourceLine" id="cb8-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/str">str</a></span>(<span class="kw"><a href="reference/cloc_by_file.html">cloc_by_file</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/system.file">system.file</a></span>(<span class="st">"extdata"</span>, <span class="dt">package=</span><span class="st">"cloc"</span>)))</a>
<a class="sourceLine" id="cb8-3" title="3"><span class="co">#&gt; Classes 'tbl_df', 'tbl' and 'data.frame':    2 obs. of  6 variables:</span></a>
<a class="sourceLine" id="cb8-4" title="4"><span class="co">#&gt;  $ source       : chr  "extdata" "extdata"</span></a>
<a class="sourceLine" id="cb8-5" title="5"><span class="co">#&gt;  $ filename     : chr  "/Library/Frameworks/R.framework/Versions/3.5/Resources/library/cloc/extdata/qrencoder.cpp" "/Library/Frameworks/R.framework/Versions/3.5/Resources/library/cloc/extdata/dbi.r"</span></a>
<a class="sourceLine" id="cb8-6" title="6"><span class="co">#&gt;  $ language     : chr  "C++" "R"</span></a>
<a class="sourceLine" id="cb8-7" title="7"><span class="co">#&gt;  $ loc          : int  142 138</span></a>
<a class="sourceLine" id="cb8-8" title="8"><span class="co">#&gt;  $ blank_lines  : int  41 24</span></a>
<a class="sourceLine" id="cb8-9" title="9"><span class="co">#&gt;  $ comment_lines: int  63 71</span></a>
<a class="sourceLine" id="cb8-10" title="10"></a>
<a class="sourceLine" id="cb8-11" title="11"><span class="co"># single file</span></a>
<a class="sourceLine" id="cb8-12" title="12"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/str">str</a></span>(<span class="kw"><a href="reference/cloc_by_file.html">cloc_by_file</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/system.file">system.file</a></span>(<span class="st">"extdata"</span>, <span class="st">"qrencoder.cpp"</span>, <span class="dt">package=</span><span class="st">"cloc"</span>)))</a>
<a class="sourceLine" id="cb8-13" title="13"><span class="co">#&gt; Classes 'tbl_df', 'tbl' and 'data.frame':    1 obs. of  6 variables:</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="co">#&gt;  $ source       : chr "qrencoder.cpp"</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="co">#&gt;  $ filename     : chr "/Library/Frameworks/R.framework/Versions/3.5/Resources/library/cloc/extdata/qrencoder.cpp"</span></a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co">#&gt;  $ language     : chr "C++"</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co">#&gt;  $ loc          : int 142</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co">#&gt;  $ blank_lines  : int 41</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt;  $ comment_lines: int 63</span></a></code></pre></div>
<p>Recognized languages</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="kw"><a href="reference/cloc_recognized_languages.html">cloc_recognized_languages</a></span>()</a>
<a class="sourceLine" id="cb9-2" title="2"><span class="co">#&gt; # A tibble: 242 x 2</span></a>
<a class="sourceLine" id="cb9-3" title="3"><span class="co">#&gt;    lang           extensions            </span></a>
<a class="sourceLine" id="cb9-4" title="4"><span class="co">#&gt;    &lt;chr&gt;          &lt;chr&gt;                 </span></a>
<a class="sourceLine" id="cb9-5" title="5"><span class="co">#&gt;  1 ABAP           abap                  </span></a>
<a class="sourceLine" id="cb9-6" title="6"><span class="co">#&gt;  2 ActionScript   as                    </span></a>
<a class="sourceLine" id="cb9-7" title="7"><span class="co">#&gt;  3 Ada            ada, adb, ads, pad    </span></a>
<a class="sourceLine" id="cb9-8" title="8"><span class="co">#&gt;  4 ADSO/IDSM      adso                  </span></a>
<a class="sourceLine" id="cb9-9" title="9"><span class="co">#&gt;  5 Agda           agda, lagda           </span></a>
<a class="sourceLine" id="cb9-10" title="10"><span class="co">#&gt;  6 AMPLE          ample, dofile, startup</span></a>
<a class="sourceLine" id="cb9-11" title="11"><span class="co">#&gt;  7 Ant            build.xml, build.xml  </span></a>
<a class="sourceLine" id="cb9-12" title="12"><span class="co">#&gt;  8 ANTLR Grammar  g, g4                 </span></a>
<a class="sourceLine" id="cb9-13" title="13"><span class="co">#&gt;  9 Apex Trigger   trigger               </span></a>
<a class="sourceLine" id="cb9-14" title="14"><span class="co">#&gt; 10 Arduino Sketch ino, pde              </span></a>
<a class="sourceLine" id="cb9-15" title="15"><span class="co">#&gt; # … with 232 more rows</span></a></code></pre></div>
<p>Strip comments and whitespace from individual source files</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/cat">cat</a></span>(</a>
<a class="sourceLine" id="cb10-2" title="2">  <span class="kw"><a href="reference/cloc_remove_comments.html">cloc_remove_comments</a></span>(<span class="st">"https://raw.githubusercontent.com/maelle/convertagd/master/README.Rmd"</span>)</a>
<a class="sourceLine" id="cb10-3" title="3">)</a>
<a class="sourceLine" id="cb10-4" title="4"><span class="co">#&gt; library("knitr")</span></a>
<a class="sourceLine" id="cb10-5" title="5"><span class="co">#&gt; library("devtools")</span></a>
<a class="sourceLine" id="cb10-6" title="6"><span class="co">#&gt; install_github("masalmon/convertagd")</span></a>
<a class="sourceLine" id="cb10-7" title="7"><span class="co">#&gt; library("convertagd")</span></a>
<a class="sourceLine" id="cb10-8" title="8"><span class="co">#&gt; file &lt;- system.file("extdata", "dummyCHAI.agd", package = "convertagd")</span></a>
<a class="sourceLine" id="cb10-9" title="9"><span class="co">#&gt; testRes &lt;- read_agd(file, tz = "GMT")</span></a>
<a class="sourceLine" id="cb10-10" title="10"><span class="co">#&gt; kable(testRes[["settings"]])</span></a>
<a class="sourceLine" id="cb10-11" title="11"><span class="co">#&gt; kable(head(testRes[["raw.data"]]))</span></a>
<a class="sourceLine" id="cb10-12" title="12"><span class="co">#&gt; path_to_directory &lt;- system.file("extdata", package = "convertagd")</span></a>
<a class="sourceLine" id="cb10-13" title="13"><span class="co">#&gt; batch_read_agd(path_to_directory, tz="GMT")</span></a></code></pre></div>
</div>
<div id="cloc-metrics" class="section level2">
<h2 class="hasAnchor">
<a href="#cloc-metrics" class="anchor"></a>cloc Metrics</h2>
<table class="table table">
<thead><tr class="header">
<th align="left">Lang</th>
<th align="right"># Files</th>
<th align="right">(%)</th>
<th align="right">LoC</th>
<th align="right">(%)</th>
<th align="right">Blank lines</th>
<th align="right">(%)</th>
<th align="right"># Lines</th>
<th align="right">(%)</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="left">R</td>
<td align="right">16</td>
<td align="right">0.94</td>
<td align="right">484</td>
<td align="right">0.95</td>
<td align="right">183</td>
<td align="right">0.83</td>
<td align="right">289</td>
<td align="right">0.8</td>
</tr>
<tr class="even">
<td align="left">Rmd</td>
<td align="right">1</td>
<td align="right">0.06</td>
<td align="right">24</td>
<td align="right">0.05</td>
<td align="right">38</td>
<td align="right">0.17</td>
<td align="right">71</td>
<td align="right">0.2</td>
</tr>
</tbody>
</table>
</div>
<div id="code-of-conduct" class="section level2">
<h2 class="hasAnchor">
<a href="#code-of-conduct" class="anchor"></a>Code of Conduct</h2>
<p>Please note that this project is released with a <a href="CONDUCT.html">Contributor Code of Conduct</a>. By participating in this project you agree to abide by its terms.</p>
</div>
</div>
  </div>

  <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
    <div class="links">
<h2>Links</h2>
<ul class="list-unstyled">
<li>Report a bug at <br><a href="https://gitlab.com/hrbrmstr/cloc/issues">https://​gitlab.com/​hrbrmstr/​cloc/​issues</a>
</li>
</ul>
</div>
<div class="license">
<h2>License</h2>
<ul class="list-unstyled">
<li>
<a href="https://opensource.org/licenses/mit-license.php">MIT</a> + file <a href="LICENSE-text.html">LICENSE</a>
</li>
</ul>
</div>
<div class="developers">
<h2>Developers</h2>
<ul class="list-unstyled">
<li>Bob Rudis <br><small class="roles"> Author, maintainer </small> <a href="https://orcid.org/0000-0001-5670-2640" target="orcid.widget"><img src="https://members.orcid.org/sites/default/files/vector_iD_icon.svg" class="orcid" alt="ORCID" height="16"></a> </li>
<li>Al Danial <br><small class="roles"> Author </small>  <br><small>(cloc perl script)</small>
</li>
<li><a href="authors.html">All authors...</a></li>
</ul>
</div>

      <div class="dev-status">
<h2>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://travis-ci.org/hrbrmstr/cloc"><img src="https://travis-ci.org/hrbrmstr/cloc.svg?branch=master" alt="Travis-CI Build Status"></a></li>
<li><a href="https://ci.appveyor.com/project/hrbrmstr/cloc"><img src="https://ci.appveyor.com/api/projects/status/github/hrbrmstr/cloc?branch=master&amp;svg=true" alt="AppVeyor Build Status"></a></li>
<li><a href="https://codecov.io/github/hrbrmstr/cloc?branch=master"><img src="https://img.shields.io/codecov/c/github/hrbrmstr/cloc/master.svg" alt="Coverage Status"></a></li>
</ul>
</div>
</div>

</div>


      <footer><div class="copyright">
  <p>Developed by Bob Rudis, Al Danial.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
      </footer>
</div>

  

  </body>
</html>