Skip to content

gabx/R-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

r-project

My R-project stuff

littler

[http://dirk.eddelbuettel.com/code/littler.html]{littler} provides a simplified command line to R. This allows direct execution of commands.

install littler

install littler using the R cran package:

R> install.packages('littler')

configure

The binary r has been installed in $R_LIBS_USER/littler/bin. Create symbolic link to /usr/local/bin/r and alias in zsh cconfig as r is a built-in command in zsh.

run

Example of small script to upgrade R packages outside any R session:

#!/usr/bin/env r 
#
# a simple example to update packages 
# parameters are easily adjustable

repos <- "http://cran.us.r-project.org"

lib.loc <- "/developement/language/r/library"

update.packages(repos=repos, ask=FALSE, lib.loc=lib.loc)

R-mkl

R built with Intel MKL library and the iic compiler prooved to be much faster than with gcc.

Elapsed time in sec from computing 15 tests with default GCC build and icc/MKL build:

274.93 sec for GCC build, 21.01 sec for icc/MKL build. More info in this post

Build R with Intel ICC compiler and MKL

This is a very basic script to build R cran with Intel 2016 Parallel studio shared libraries. The script has to be executed in the source directory.

#! /bin/sh

source /opt/intel/compilers_and_libraries_2016.0.109/linux/mkl/bin/mklvars.sh intel64
source /opt/intel/bin/compilervars.sh intel64

_mkllibpath=${MKLROOT}/lib/intel64

MKL=" -L${_mkllibpath} -lmkl_rt -lpthread"

export CC="icc"
export CXX="icpc"
export AR="xiar"
export LD="xild"
export F77="ifort"

export CFLAGS="-g -O3 -xHost -I${MKLROOT}/include"
export CXXFLAGS="-g -O3 -xHost -I${MKLROOT}/include"
export FFLAGS="-I${MKLROOT}/include"
export FCFLAGS="-I${MKLROOT}/include"

./configure --with-blas="${MKL}" --with-lapack 

make -j4

Build for Fedora x86_64

Use the R-mkl/R-intel.spec file as a template to build a .rpm package for FEDORA x86_64 >= 22.

###benchmark.R

This script is aimed at gauging how fast R is running on your computer.

require(Matrix)
require(SuppDists)
source(benchmark.R)

R-studio-server

Use the R-studio-server/rstudio-server.spec file as a template to build a .rpm package for FEDORA x86_64 >= 22.

code

  • Random code from Coursera Data Science
  • R-slacklog: code to fetch history from Slack channel; clean, sort and tidy data; store the data in a DB

config

A collection fo files in my ~/.config/r directory on a Archlinux machine. On this machine, most program config files are gathered in the $XDG_HOME_CONFIG folder.

  • Renviron

A very few basic var:value lines.

  • Rprofile.R

This file is sourced at R start-up. It has grown and improved over time.

documentation

A collection of useful documentations in .pdf format . Beginner and advance, french and english.

helper

A random collection of short code to help daily work in R. To load these functions and avoid to pollute top-level namespace, best is to build a R package . I prefere a lightweight alternative : source the helper.R script in a dedicated environment. See ?sys.source, ?new.env and this stackoverfolw thread for more info.

About

Various projects in R environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages