A personalized setup for R
. I've found it useful to add
library(setup)
to my .Rprofile
, maybe others will too. Always
changing, never any goals for stabilization.
library("setup", quietly = TRUE, warn.conflicts = FALSE)
The guiding principle of the setup
package is to include
functionality that is intended exclusively for interative sessions
and not in scripts or packages that are intended for other users.
The recommended way to use setup
is to
fork it and modify as
desired for your needs in interactive sessions.
knitr
chunksR
's symbolic differentiation toolsbash
Quick random matrices!
rmat(5, 3)
## [,1] [,2] [,3]
## [1,] -0.66632144 1.3042986 0.1259268
## [2,] -0.75127404 -1.2725709 -0.1596205
## [3,] -0.46391447 -1.1113941 -1.3869535
## [4,] 0.07424689 0.8562972 1.4712344
## [5,] -0.47383856 -2.0638588 0.4354084
Symbolic differentiation without expressions!
gradient("(x^2)/y", c("x", "y"))
## gradient
## x 2 * x/y
## y -((x^2)/y^2)
hessian("(x^2)/y", c("x", "y"))
## x y
## x 2/y -(2 * x/y^2)
## y -(2 * x/y^2) (x^2) * (2 * y)/(y^2)^2
Using
tarName
in a makefile.
PKG = lme4
TAR = $(shell Rscript -e "tarName(\"$(PKG)\")")
BUILD = R CMD build --no-build-vignettes
INSTALL = R CMD install
CHECK = R CMD check
all: $(TAR) install
$(TAR):
$(BUILD) $(PKG)
install: $(TAR)
$(INSTALL) $(TAR)
check: $(TAR)
$(CHECK) $(TAR)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.