-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathR.txt
More file actions
1690 lines (1265 loc) · 50.9 KB
/
R.txt
File metadata and controls
1690 lines (1265 loc) · 50.9 KB
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
━━━━━━━━━━━━━━
R
Grant Rettke
━━━━━━━━━━━━━━
1 Control Files
═══════════════
Remember to link these from `~/' to here. Automate it.
The goal here is to get R set up thoughtfully and quickly. The profile
and environ set it up correctly. Always remember this and run R using
those configuration files.
When R starts, it won't find any of the required packages. It will
complain a lot. That is OK. Just keep running the install script until
it is happy `source("~/.Rinstall")'. Then restart R and everything
should be fine.
Many things happen during this package installation process. Some are
R specific and some have to do with the machine that you are running
on. Both are mentioned here:
• Check the version that is running
• Go back and read the transcript and make sure that it looks right
• Eventually that script will fail, for example
• there is no package called ‘devtools’
• Called `install.packages("devtools")' manually
• Install order error
• After running it a couple of times, it is finished
My old config started R without the init-file. That was dumb. It
created a lot of needless hassle without any significant benefit.
*.Rprofile*
┌────
│ ## -*- mode: R; -*-
│ «rprofile-def»
│ .First <- function() {
│ gcr <- new.env()
│ «rfirst-defs»
│ base::attach(gcr, name="gcr", warn.conflicts=FALSE)
│ }
│ fortune()
└────
*.Renviron*
┌────
│ # -*- mode: sh; -*-
│ «renviron-def»
└────
*.Rinstall*
┌────
│ # -*- mode: R; -*-
│ «rinstall-def»
└────
1.1 .Rprofile [1]
─────────────────
• When you install packages, R needs to know which repository it
should use. If you don't tell it, then it will ask you every time.
It is just doing its job. Make it easier for yourself and specify a
repo for once and for all.
• Via [2]
• Built-in docs explain that `local' should be used here
• This could also be a one-liner: `options("repos" = c(CRAN =
"http://cran.r-project.org/"))'
┌────
│ local({
│ r = getOption("repos")
│ r["CRAN"] = "http://cran.r-project.org/"
│ options(repos = r)
│ })
└────
• By default, hitting enter in the `browser' will submit a `c' for
"continue execution at the next statement"
• It is too easy to hit enter when you didn't mean it
• It just /feels/ imprecise
• Never let this happen, disable that feature
┌────
│ options(browserNLdisabled = TRUE)
└────
Show timestamps to 3 sub-seconds:
┌────
│ options("digits.secs"=3)
└────
Do not allow automatic coercion of strings into factors, as you can
specify this by argument to make it /real/ obvious. Looks like the
best way is to leave it alone globally and always do it by hand
though. hwickam commented that it is bad, bad idea to make this option
global not because of your code, but because of everyone else's that
you are using which relies on the option being set to `TRUE'.
┌────
│ options(stringsAsFactors=TRUE)
└────
This might be /too much/, but always show a call stack when *any*
warnings or errors occur
┌────
│ options(showWarnCalls=TRUE)
│ options(showErrorCalls=TRUE)
└────
Be highly conservative about errors and warnings: handle the former
immediately and cause the latter to be errors. However, only do this
after your workspace has initialized correctly. Do so too soon and
most things won't work because this approach is only to handle /my/
issues. Imagine of the whole work just handled their own issues!
Anway, the safe values are set here, leave them alone. Making them
more aggressive will break your startup. When you are ready to set
things to be more aggressive, turn it on yourself
┌────
│ options(error=NULL)
│ options(warn=0)
└────
Don't print more than 500 lines. If you can grok more than 500 lines
then please teach me. Be at ease, there is a helper to remove that
restriction, just in case.
┌────
│ options(max.print=500)
└────
Partial matching is a neat and flexible feature for objects. In
theory, it is quite powerful and convenient. In practice it seems like
a really bad idea to me. It is a /personal preference/. It only makes
sense from that perspective. This could bork 3rd party code.
┌────
│ options(warnPartialMatchDollar = TRUE)
└────
Locale:
• Make sure that the language is set correctly. I couldn't find
anything specific about setting it this way other than various
posts. In practice you would really put all of this in your system
environment configuration, but I'm wanting to be a little more
particular here because it affects operations on data structures, in
particular sorting.
• Error messages are mostly useful when they are displayed in English,
so make sure that the locale is always English [3]. "Note that the
LANGUAGE environment variable has precedence over `LC_MESSAGES' in
selecting the language for message translation on most R platforms."
[4]
• Note:
• My previous approach was to define a top level binding for the
locale string and pass that reference to bind each of the
following settings. That was fine until I wanted to be able to
easily clear out all of the top-level bindngs to "reset" it with a
`rm(ls())' kind of thing. For that reason, I just use the manifest
strings here.
┌────
│ Sys.setenv(LANG = "en_US.UTF-8")
│ Sys.setlocale("LC_COLLATE", "en_US.UTF-8")
│ Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
└────
1.1.1 Packages
╌╌╌╌╌╌╌╌╌╌╌╌╌╌
<2014-11-14 Fri> Below is a try to auto-install packages if they are
not available, and, it seems to have failed. Perhaps there is a better
way, and I do need to find it. Until then I will install as-needed. As
such, I suppose that I've found it.
◊ 1.1.1.1 assertthat
Design-by-contract [5] is a great, great thing. Make it much easier
with valuable functionsand useful messages!
Cheatsheet:
• Always use `assert_that'
• Use
• ℝ built ins to check tests
• Additionally via `assertthat':
• `is.flag'
• `is.string'
• `has_name'
• `has_attr'
• `is.count'
• `are_equal'
• `not_empty'
• `noNA'
• `is.dir'
• `is.writeable' and `is.readable'
• `has_extension'
┌────
│ library(assertthat)
└────
┌────
│ if(! require(assertthat)){
│ install.packages("assertthat")
│ }
└────
◊ 1.1.1.2 testthat
Design-by-contract and unit-tests [6] go hand-in-hand.
Expectations:
• `equals() :': uses `all.equal()' to check for equality with
numerical tolerance
• Shorthand: `expect_equal(x, y)'
• uses `identical()' to check for exact equality
• Shorthand: `expect_identical(x, y)'
• is a more relaxed version of `equals()' that
ignores attributes
• Shorthand: `expect_equivalent(x, y)'
• checks that an object `inherit()''s from a specified class
• Shorthand: `expect_is(x, y)'
• matches a character vector against a regular expression.
• The optional all argument controls where all elements or just one
element need to match.
• Shorthand: `expect_matches(x, y)'
• matches the printed output from an expression against a
regular expression
• Shorthand: `expect_output(x, y)'
• checks that an expression shows a message
• Shorthand: `expect_message(x, y)'
• expects that you get a warning
• Shorthand: `expect_warning(x, y)'
• verifies that the expression throws an error.
• You can also supply a regular expression which is applied to the
text of the error
• Shorthand: `expect_error(x, y)'
• is a useful catchall if none of the other expectations do
what you want - it checks that an expression is true
• `is_false()' is the complement of `is_true()'
• Shorthand: `expect_true(x)'
• Shorthand: `expect_false(x)'
• Notes
• "Each test is run in its own environment so it is self-contained."
• Plain old code so you can modify the global environment FYI
┌────
│ library(testthat)
└────
┌────
│ if(! require(testthat)) {
│ install.packages("testthat")
│ }
└────
◊ 1.1.1.3 stringr
Make it really easy to work with strings [7]. That is indeed a good
goal, and the reason that I installed this initially was because
`testthat' mentions that it is used.
┌────
│ library(stringr)
└────
┌────
│ if(! require(stringr)) {
│ install.packages("stringr")
│ }
└────
◊ 1.1.1.4 sqldf
How you extract data from a dataframe is flexible and everyone can and
may do it differently. One option available is to use `SQL' [8], so
make it available.
Comments taken from [9]
• "This [using SQL] is a skill that every analyst should possess"
• "Being able to write SQL will save you time and provide you with a
way of getting repeatable results so that you don't have to focus on
doing the calculations all the time and worrying about errors in
Excel"
• "[instead] You can focus on the task of actually analyzing your
data"
Notes from the user manual [10]
• Interesting package info
• "Title Perform SQL Selects on R Data Frames"
• "Author G. Grothendieck <ggrothendieck@gmail.com>"
• "Description Description: Manipulate R data frames using SQL."
• "Depends R (>= 2.14.0), gsubfn (>= 0.6), proto, RSQLite (>=
0.8-0),RSQLite.extfuns"
• Google group mentioned [11], joined it
• Official site mentioned and it has good docs
• Seems to uses SQLLite
• `read.csv.sql'
• "Read a file into R filtering it with an sql statement. Only the
filtered portion is processed by R so that files larger than R can
otherwise handle can be accommodated."
• Parms
• Handles `http' and `ftp' `URLs'
• `filter'
• "If specified, this should be a shell/batch command that the
input file is piped through. For read.csv2.sql it is by
default the following on non-Windows systems: tr , .. This
translates all commas in the file to dots."
• Why is that specific example mentioned?
• `field.types'
• State the SQLite types for the column names
• Rarely needed
• `dbname'
• "As in `sqldf' except that the default is `tempfile()'.
Specifying `NULL' will put the database in memory which may
improve speed but will limit the size of the database by the
available memory."
• Details
• "Reads the indicated file into an sql database creating the
database if it does not already exist. Then it applies the sql
statement returning the result as a data frame. If the database
did not exist prior to this statement it is removed."
• "Note that it uses facilities of SQLite to read the file which
are intended for speed and therefore not as flexible as in R.
For example, it does not recognize quoted fields as special but
will regard the quotes as part of the field. See the sqldf help
for more information."
• "`read.csv2.sql' is like `read.csv.sql' except the default sep
is ";" and the default filter translates all commas in the file
to decimal points (i.e. to dots)."
• Value
• "If the sql statement is a select statement then a data frame is
returned."
• `sqldf'
Description: SQL select on data frames
: Arguments
• =stringsAsFactors does what you think
• `row.names' could be useful
• `envir' could make it safer
• `method' determines how to type the data from the database into
a dataframe
• Looks like a *powerhouse* feature
• Could greatly simplify data brokering
• `file.format'
• `eol' handling mentioned across platforms
• Ran into this with the built-in reader
• `dbname'
• SQLite creates an in-memory database!
: Details
• The typical action of sqldf is to
• in memory
• used in the select statement.
This is done by scanning the
select statement to see which
words in the select statement are
of class "data.frame" or "file"
in the parent frame, or the
specified environment if envir is
used, and for each object found
by reading it into the database
if it is a data frame. Note that
this heuristic usually reads in
the wanted data frames and files
but on occasion may harmlessly
reads in extra ones too.
• getting the result as a data frame
• of the returned data frame’s columns if method =
"auto". This is done by checking all the column
names in the read-in data frames and if any are
the same as a column output from the data base
then that column is coerced to the class of the
column whose name matched. If the class of the
column is "factor" or "ordered" or if the column
is not matched then the column is returned as
is. If method = "auto.factor" then processing is
similar except that "factor" and "ordered"
classes and their levels will be assigned as
well. The "auto.factor" heuristic is less
reliable than the "auto" heuristic. If method =
"raw" then the classes are returned as is from
the database.
• If the database was created by sqldf then it is deleted;
otherwise, all tables that were created are dropped in
order to leave the database in the same state that it was
before. The database connection is terminated.
• Although sqldf is usually used with on-the-fly databases
which it automatically sets up and destroys if you wish to
use it with existing databases be sure to back up your
database prior to using it since incorrect operation could
destroy the entire database.
: Value
• The result of the specified select statement is output as a data
frame.
• If a vector of sql statements is given as x then the result of
the last one is returned.
• If the x and connection arguments are missing then it returns a
new connection and also places this connection in the option
sqldf.connection.
• Great to know that the connection is cached!
: Notes
• Big FYI: Commas in columns will be parsed as column separators!
• Recommends using `read.table' if this matter
: Examples
• They all demonstrate how to do it in R and then again with SQL
• Super helpful
• You seem to be able to do everything that you would expect
possible
: Thoughts
• Need to grok both R and SQL to use this safely
• Using temp tables is kind of huge
• Via [12]
• Use `_' instead lf `.' in column names from a R call
• Where is this in the documentation?
Notes from the official site [13]
• Opening
• How it works
• The user simply specifies an SQL statement
• in R using data frame names in place of table names
• and a database with appropriate table layouts/schema is
automatically created,
• the data frames are automatically loaded into the database,
• the specified SQL statement is performed,
• the result is read back into R
• and the database is deleted all automatically behind the scenes
making the database's existence transparent to the user who only
specifies the SQL statement.
• Supports
• SQLite
• H2
• PostgreSQL
• MySQL
• The FAQ mostly talks about SQLite
• Overview
• with sqldf the user is freed from having to do the following, all
of which are automatically done:
• database setup
• writing the create table statement which defines each table
• importing and exporting to and from the database
• coercing of the returned columns to the appropriate class in
common cases
• It an be used for
• learning R if you know SQL
• Doing it faster than R
• Load portions of a really large file
• Troubleshooting
• Set the driver expicitly
• "error messages regarding a data frame that has a dot in its name.
The dot is an SQL operator. Either quote the name appropriately or
change the name of the data frame to one without a dot."
• FAQ
• Column class conversion touched upon
• Dots in names
• Dots are SQL operators so can't use them
• See `?SQL92Keywords'
• For columns
• Either use underscore
• Or simply remove them
• For tables
• Double quote the name
• H2 supports date types, which seems quite helpful
• Name a column ending with two underscores and a type and the
library will convert the type to R correctly
• Mentioned in the docs
• SQL is case *insensitive*
• Don't rely on casing to differentiate column names
• We may examine the in-memory database table structure
• Be quite careful about CSV data that contains commas again as this
lib won't handle it
• Good examples of cleaning data gettig int into a R friendly format
• Be sure to specify numeric values as integers or doubles so you
get expected results from division
• Examples
• Example 1. Ordering and Limiting
• Example 2. Averaging and Grouping
• Example 3. Nested Select
• Example 4. Join
• Example 5. Insert Variables
• Hugely convenient
• Example 6. File Input
• Example 7. Nested Select
• Example 8. Specifying File Format
• Example 9. Working with Databases
• Example 10. Persistent Connections
• Example 11. Between and Alternatives
• Example 12. Combine two files in permanent database
• Example 13. read.csv.sql and read.csv2.sql
• Uses SQLite's import facility to create an in-memory database
• Then it reads the results of the query into R
• The import does not involve R so it can handle larger files than
R can assuming that the query results in a size that does fit
• Example 14. Use of spatialite library functions
• Example 15. Use of RSQLite.extfuns library functions
• Example 16. Moving Average
SQLite, SQL As Understood By SQLite:
• [Core Functions]
• [Aggregate Functions]
• [Date And Time Functions]
• These previous are all provided by [RSQLite.extfuns]
┌────
│ library(sqldf)
└────
┌────
│ if(! require(sqldf)) {
│ install.packages("sqldf")
│ }
└────
[Core Functions] https://www.sqlite.org/lang_corefunc.html
[Aggregate Functions] https://www.sqlite.org/lang_aggfunc.html
[Date And Time Functions] https://www.sqlite.org/lang_datefunc.html
[RSQLite.extfuns]
http://cran.r-project.org/web/packages/RSQLite.extfuns/index.html
◊ 1.1.1.5 MASS
"Functions and datasets to support Venables and Ripley, 'Modern
Applied Statistics with S' (4th edition, 2002)." Also, `sqldf'
recommended it be installed, so it is the right time. [14]
┌────
│ library(MASS)
└────
┌────
│ if(! require(MASS)) {
│ install.packages("MASS")
│ }
└────
◊ 1.1.1.6 jsonlite
Make it easy to work with JSON [37138455:
[http://cran.r-project.org/web/packages/jsonlite/index.html]]. Reading
the vignette's, it does a lot more, for example `rbind.pages'.
┌────
│ library(jsonlite)
└────
┌────
│ if(! require(jsonlite)) {
│ install.packages("jsonlite")
│ }
└────
◊ 1.1.1.7 data.table
`data.table' [15] is quite nice.
┌────
│ library(data.table)
└────
┌────
│ if(! require(data.table)) {
│ install.packages("data.table")
│ }
└────
◊ 1.1.1.8 xlsx
Read and write Excel files [16].
┌────
│ library(xlsx)
└────
┌────
│ if(! require(xlsx)) {
│ install.packages("xlsx")
│ }
└────
◊ 1.1.1.9 XML
Make ℝ truly enterprise [17].
┌────
│ library(XML)
└────
┌────
│ if(! require(XML)) {
│ install.packages("XML")
│ }
└────
◊ 1.1.1.10 devtools
`devtools': Tools to make developing ℝ code easier
[Collection of package development tools]
That is a bit too terse. Intro to the README follows
The aim of devtools is to make your life as a package
developer easier by providing R functions that simplify
many common tasks. R packages are actually really simple,
and with the right tools it should be easier to use the
package structure than not. Package development in R can
feel intimidating, but devtools does every thing it can to
make it as welcoming as possible. devtools comes with a
small guarantee: if because of a bug in devtools a member
of R-core gets angry with you, I will send you a
handwritten apology note. Just forward me the email and
your address, and I'll get a card in the mail.
Excellent.
[Readme]. [Manual]. [Github].
At the very least, just /know of/ this package, as you will be
installing it if you want to us `tidyr'.
┌────
│ library(devtools)
└────
┌────
│ if(! require(devtools)) {
│ install.packages("devtools")
│ devtools::install_github("hadley/devtools")
│ }
└────
[Collection of package development tools]
http://cran.r-project.org/web/packages/devtools/index.html
[Readme] http://cran.r-project.org/web/packages/devtools/README.html
[Manual] http://cran.r-project.org/web/packages/devtools/devtools.pdf
[Github] https://github.com/hadley/devtools
◊ 1.1.1.11 magrittr
This is a add from the /most understated package definition/ of the
year department. `magrittr' [18] is, much like every Scheme library
ever, deceptively simple in its power and ease of use that it
provides.
┌────
│ library(magrittr)
└────
┌────
│ if(! require(magrittr)) {
│ devtools::install_github("smbache/magrittr")
│ }
└────
◊ 1.1.1.12 reshape2
`reshape2': Flexibly reshape data: a reboot of the `reshape' package
Reshape lets you flexibly restructure and aggregate data
using just two functions: melt and cast.
[CRAN]. [Manual]. [Github].
This seems to be a defacto standard.
┌────
│ library(reshape2)
└────
┌────
│ if(! require(reshape2)) {
│ install.packages("reshape2")
│ }
└────
[CRAN] http://cran.r-project.org/web/packages/reshape2/index.html
[Manual] http://cran.r-project.org/web/packages/reshape2/reshape2.pdf
[Github] https://github.com/hadley/reshape/blob/master/README.md
◊ 1.1.1.13 tidyr
`tidyr': Easily tidy data with spread and gather functions for ℝ
[tidyr] is an evolution of reshape2. It's design
specifically for data tidying (not general reshaping or
aggregating) and works well with dplyr data pipelines.
[Readme]. [Manual]. [Github].
Not on CRAN yet so install via
┌────
│ library(tidyr)
└────
┌────
│ if(! require(tidyr)) {
│ devtools::install_github("hadley/tidyr")
│ }
└────
[tidyr] http://cran.r-project.org/web/packages/tidyr/index.html
[Readme] http://cran.r-project.org/web/packages/tidyr/README.html
[Manual] http://cran.r-project.org/web/packages/tidyr/tidyr.pdf
[Github] https://github.com/hadley/tidyr
◊ 1.1.1.14 lubridate
lubridate: Make dealing with dates a little easier in ℝ
[Lubridate] makes it easier to work with dates and times
by providing functions to identify and parse date-time
data, extract and modify components of a date-time (years,
months, days, hours, minutes, and seconds), perform
accurate math on date-times, handle time zones and
Daylight Savings Time. Lubridate has a consistent,
memorable syntax, that makes working with dates fun
instead of frustrating.
[Manual]. [Vignette].
┌────
│ library(lubridate)
└────
┌────
│ if(! require(lubridate)) {
│ install.packages("lubridate")
│ }
└────
Perhaps in some /time/ there will be a unified approach to
time-management among all programming languages.
[Lubridate]
http://cran.r-project.org/web/packages/lubridate/index.html
[Manual]
http://cran.r-project.org/web/packages/lubridate/lubridate.pdf
[Vignette]
http://cran.r-project.org/web/packages/lubridate/vignettes/lubridate.html
◊ 1.1.1.15 plyr
plyr: Tools for splitting, applying and combining data in R
[plyr] is a set of tools that solves a common set of
problems: you need to break a big problem down into
manageable pieces, operate on each pieces and then put all
the pieces back together. For example, you might want to
fit a model to each spatial location or time point in your
study, summarise data by panels or collapse
high-dimensional arrays to simpler summary statistics. The
development of plyr has been generously supported by BD
(Becton Dickinson).
[Readme]. [Manual]. [Home page]. [Github].
┌────
│ library(plyr)
└────
┌────
│ if(! require(plyr)) {
│ install.packages("plyr")
│ }
└────
[plyr] http://cran.r-project.org/web/packages/plyr/index.html
[Readme] http://cran.r-project.org/web/packages/plyr/README.html
[Manual] http://cran.r-project.org/web/packages/plyr/plyr.pdf
[Home page] http://plyr.had.co.nz/
[Github] https://github.com/hadley/plyr
◊ 1.1.1.16 dplyr
dplyr: a grammar of data manipulation in R
The fact that I am loading both `plyr' and `dplyr' is something that I
am questioning. I do so because I learned them in that order, so left
it that way. However, this just results in *more* binding shadowing,
and I am not sure of the implications, and they are usually never
good.
[A fast, consistent tool] for working with data frame like
objects, both in memory and out of memory.
[Readme]. [Manual]. [Introduction to dplyr].
┌────
│ library(dplyr)
└────
┌────
│ if(! require(dplyr)) {
│ install.packages("dplyr")
│ }
└────
[A fast, consistent tool]
http://cran.r-project.org/web/packages/dplyr/index.html
[Readme] http://cran.r-project.org/web/packages/dplyr/README.html
[Manual] http://cran.r-project.org/web/packages/dplyr/dplyr.pdf
[Introduction to dplyr]
http://cran.r-project.org/web/packages/dplyr/vignettes/introduction.html
◊ 1.1.1.17 testit
testit: A simple package for testing R packages
[GitHub]. [CRAN]. [Manual].
Gives you `assert' and `test_pkg'. Save characters.
┌────
│ library(testit)
└────
┌────
│ if(! require(testit)) {
│ install.packages("testit")
│ }
└────
[GitHub] https://github.com/yihui/testit
[CRAN] http://cran.rstudio.com/web/packages/testit/index.html
[Manual] http://cran.rstudio.com/web/packages/testit/testit.pdf
◊ 1.1.1.18 markdown
• [CRAN]
• [reference]
• [vignettes: markdown-examples]
• [vignettes: markdown-output]
• [GitHub]
┌────
│ library(markdown)
└────
┌────
│ if(! require(markdown)) {
│ install.packages("markdown")
│ }
└────
This package is referred to as R Markdown v1 when combined
with knitr. The primary output format is HTML. Now we have
introduced R Markdown v2, which is based on Pandoc and
knitr, and supports much more types of output formats.
[CRAN] http://cran.r-project.org/web/packages/markdown/index.html
[reference]
http://cran.r-project.org/web/packages/markdown/markdown.pdf
[vignettes: markdown-examples]
http://cran.r-project.org/web/packages/markdown/vignettes/markdown-examples.html
[vignettes: markdown-output]
http://cran.r-project.org/web/packages/markdown/vignettes/markdown-output.html
[GitHub] https://github.com/rstudio/markdown
◊ 1.1.1.19 knitr
knitr: A general-purpose package for dynamic report generation in R
Read the [home page]. It has great resources.
Watched [the video]. Very nice to see; comfortable and familiar. Need
to set up RStudio for it. Clearly a critical tool. Cites Knuth.
Features are amazingly understated. If you've worked with all of these
tools, you will appreciate the importance of the author's effort!
`Objects', `Options', `Hooks', and `Patterns' … what is this, Emacs?
There are demo [links]. There is a [project for examples]. This
[showcase] has links to websites, book reviews, solutions, R packages,
courses, workshops and presentations, books, papers and reports,
wrappers, and blog posts on `knitr'.
[Here] is the GitHub project. Read the motivations and see the hours
and days and weeks that you have had spared! Uses `testit', so read up
on that and added it.
Read the [Frequently Asked Questions]. Joined the [mailing list].
`ess' supports it. Sure that I can configure the custom prompt. Great
`README'.
[CRAN] as expected. Much better summary eg HTML, Makrdown,
reStructuredText, and AsciiDoc are mentioned. Curious about the
cacheing, and how I would do it in `org'. Custom code to run before
and after a hunk are another thoughtful touch one would expect coming
from `org'. Also support Python and shell. The LaTeX and LyX support
is also pretty neat. Same [READM]E. [Reference].
Somehow missed the [reference card] initially.
[How to build package vignettes with knitr].
┌────
│ library(knitr)
└────
┌────
│ if(! require(knitr)) {
│ install.packages("knitr")
│ }
└────
[home page] http://yihui.name/knitr/
[the video] https://www.screenr.com/qcv8
[links] http://yihui.name/knitr/demos
[project for examples] https://github.com/yihui/knitr-examples
[showcase] http://yihui.name/knitr/demo/showcase/
[Here] https://github.com/yihui/knitr
[Frequently Asked Questions]
https://github.com/yihui/knitr/blob/master/FAQ.md
[mailing list] https://groups.google.com/forum/#!forum/knitr
[CRAN] http://cran.r-project.org/web/packages/knitr/index.html
[READM] http://cran.r-project.org/web/packages/knitr/README.html
[Reference] http://cran.r-project.org/web/packages/knitr/knitr.pdf
[reference card]
http://cran.r-project.org/web/packages/knitr/vignettes/knitr-refcard.pdf
[How to build package vignettes with knitr]
http://yihui.name/knitr/demo/vignette/
◊ 1.1.1.20 slidify
• [HomePage]
• No CRAN
• [GitHub]
┌────
│ library(slidify)
└────
┌────