A tutorial from on reproducible research with Docker containers ropenscilabs.github.io/r-docker-tutor #rstats
One R Tip a Day
@RLangTip
One tip per day M-F on the R programming language #rstats. Brought to you by the R community team at Microsoft.
Joined May 2011
One R Tip a Day’s Tweets
boot(data,statistic,R) in the {boot} package will generate R bootstrap replicates of a statistic cran.r-project.org/package=boot #rstats
6
15
Use saveRDS(obj,"myfile") and readRDS(obj,"myfile") to save / read an R object to / from a file rdocumentation.org/packages/base/ #rstats
7
19
To debug warnings, options(warn=2) converts warnings into errors rdocumentation.org/packages/base/ #rstats
8
11
Strip non-ASCII characters from a string with iconv(rich.text, to="ASCII", sub="") #rstats rdocumentation.org/packages/base/
7
15
If two packages define functions with the same name, use :: to call the one you want: stackoverflow.com/q/39137110/154 #rstats
11
9
Meet other R users at a local R user group in your area: jumpingrivers.github.io/meetingsR/r-us #rstats
5
7
Use the Matrix package for efficient linear algebra with sparse, symmetric, positive semidefinite and general matrices jimskinner.github.io/post/elegant-l #rstats
7
10
The "round" function uses the "round-to-even" rule. round(3.5) and round(4.5) are both 4 rdocumentation.org/packages/base/ #rstats
2
26
51
Look here rdocumentation.org/packages/base/ for documentation on mathematical functions like beta(a,b) or gamma(x) #rstats
4
7
Use R to add text, tables and charts to a Word or Powerpoint template with the officer package #rstats davidgohel.github.io/officer/
10
28
The story behind R release names like "Very Secure Dishes" livefreeordichotomize.com/2017/09/28/r-r #rstats
7
9
Use TRUE and FALSE to represent the boolean values. These are reserved words, unlike T and F which can be overwritten as variables.
1
11
37
Use colSums to quickly calculate totals from the columns of a large matrix or table: rdocumentation.org/packages/base/ #rstats
9
17
Type ?Syntax to learn the precedence of operators in the R language: rdocumentation.org/packages/base/ #rstats
6
16
What They Forgot to Teach You About R: e-book on the common sources of friction in data analysis with R, by and rstats.wtf #rstats
19
64
format(x, scientific=TRUE) prints numeric data in exponential format, so 0.0001 prints as 1e-04 rdocumentation.org/packages/base/ #rstats
10
20
Data Carpentry for Biologists: a self-guided 15-week course with videos and exercises in R datacarpentry.org/semester-biolo #rstats
14
21
12
13
rle(x) ("run-length encoding") computes the lengths of runs of equal values in a vector rdocumentation.org/packages/base/ #rstats
6
11
Forgot to save the output from the last R command? Retrieve it with
v <- .Last.value
rdocumentation.org/packages/base/ #rstats
16
53
Locate the largest number in a vector with which.max(mydata) rdocumentation.org/packages/base/ #rstats
1
7
18
Machine Learning for Beginners: an open-source 12-week curriculum with lessons in R #rstats (and Python)
1
39
135
14
49
6
11
Display (and record) information about your R session including R version, platform and attached packages with sessionInfo() #rstats
8
12
6
18
R code and a Shiny app to convert a digital image into Lego bricks: joachim-gassen.github.io/2021/01/meet-l #rstats
7
13
Need to put R output in a book or paper? Use options(width=60) to limit output to a narrow column. rdocumentation.org/packages/base/ #rstats
10
25
The # character introduces comments in R. Everything after the # character to end-of-line is ignored by the interpreter. #rstats
10
23
The glmnet package fits the entire lasso or elastic-net regularization path for linear models cran.r-project.org/package=glmnet #rstats
6
15
Introduction to Emacs Speaks Statistics, which provides an R interface for GNU Emacs ess-intro.github.io #rstats
8
17
Looking for a new look for your R charts? The "feather" package provides color palettes based on the plumage of Australian birds github.com/shandiya/feath #rstats
5
24
60
11
45
Type ?"?" or ?Question at the command line (or follow this link) to get help with help in R rdocumentation.org/packages/utils #rstats
1
5
6
convolve(x,y) uses the Fast Fourier Transform to convolve two sequences of the same length rdocumentation.org/packages/stats #rstats
6
12
6
11
5
14
12
31
Negative indexes remove elements from a vector. x[-1] is x without the first element rdocumentation.org/packages/base/ #rstats
8
17


