How to update R software in windows?

Nowadaysthe R software update on Windows is not more a boring task. The R can be easily updated with the “installr” package. Just follow these steps:
  1. Install the package using install.packages(“installr”)
  2. Load package with library(“installr”)
  3. Use the function updateR() to update!

The dialog box will be opened to take you through the following steps:
  1. It checks for a newer version of R.
  2. If one exists, the function will download the most updated R version and run its installer.
  3. Once done, the function will offer to copy (or move) all of the packages from the old R library to the new R library.
  4. It will then offer to update the moved packages, offer to open the new Rgui, and lastely, it will quit the old R.

A sphere in R using rgl package

The rgl.spheres function is a fantastic way to plot spheres! Look at!

library("rgl")

rgl.spheres(1,1,1,radius=1,color="blue")

YES! yes, it’s very simple. I will describe the procedure:

1. You should create the file with code R. Command-line parameters are accessible via commandArgs().

2. You can use Rscript on all platforms, including Windows. It will support commandArgs(), for example: In the terminal

Rscript myscript.R arg1 arg2 arg3

arg1, arg2 and arg3 are arguments into your R script. If your args are strings with spaces in them, enclose within double quotes. There are two add-on packages on CRAN — getopt and optparse — which were both written for command-line parsing.

Tiny example: script.R

options(echo=TRUE) # To see commands in output file
args <- commandArgs(trailingOnly = TRUE) 
# trailingOnly=TRUE means that only your 
# arguments are returned
print(args) 

start_date <- as.Date(args[1]) # First argument
figure_name <- args[2] # Second argument
n <- as.integer(args[3]) # Third argument
rm(args)

# Some computations:
x <- rnorm(n)
postscript(paste(figure_name,".eps",sep=""))
plot(start_date+(1L:n), x,type="l")
dev.off()

summary(x)

To run:

Rscript script.R 02/06/2015 figure 1000

Booktabs package and Sweave

The booktabs package in latex makes really beautiful tables. This package provide some additional commands to enhance the quality of table in LaTeX, especially if there is math in your table that might run up against the regular \hline in the tabular environment. I created a table with the following code:

% file: example.Rnw
% require xtable
\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table}[!h] 
\centering
\caption{This is my table.}
\label{tab:table1}
<<mytable,echo=F,results=tex>>=
mat <- as.data.frame(matrix(runif(25),nrow=5))
colnames(mat) <- c("$\\alpha$","$\\beta$",
"$\\gamma$","$\\delta$","$\\frac{\\epsilon}{2}$")
rownames(mat) <- c(‘A’,’B’,’C’,’D’,’E’)
mat <- xtable::xtable(mat,digits=rep(5,ncol(mat)+1))
print(mat, 
sanitize.text.function = 
    function(x){x},
        floating=FALSE, 
        hline.after=NULL, 
        add.to.row=list(pos=list(-1,0,
        nrow(mat)), command=c('\\toprule\n',
        '\\midrule\n','\\bottomrule\n')))
@
\end{table}
\end{document}

 

You can use to compile:

$ R CMD Sweave example.Rnw
$ pdflatex example.tex

The definition of \toprule\midrule and \bottomrule from
booktabs package is:

\def\toprule{\noalign{\ifnum0=`}\fi
  \@aboverulesep=\abovetopsep
  \global\@belowrulesep=\belowrulesep 
  \global\@thisruleclass=\@ne
  \@ifnextchar[{\@BTrule}{\@BTrule[\heavyrulewidth]}}
\def\midrule{\noalign{\ifnum0=`}\fi
  \@aboverulesep=\aboverulesep
  \global\@belowrulesep=\belowrulesep
  \global\@thisruleclass=\@ne
  \@ifnextchar[{\@BTrule}{\@BTrule[\lightrulewidth]}}
\def\bottomrule{\noalign{\ifnum0=`}\fi
  \@aboverulesep=\aboverulesep
  \global\@belowrulesep=\belowbottomsep
  \global\@thisruleclass=\@ne
  \@ifnextchar[{\@BTrule}{\@BTrule[\heavyrulewidth]}}
set.seed(34567)
x <- runif(10); y <- 4*x+rnorm(10) 
fit <- lm(y~x)
r2 <- summary(fit)$r.squared

# plot data and regression line
plot(x, y)
abline(fit, col=2)

# add text to plot with legend()
legend('topleft', title='option 1', 
legend=sprintf("y = %3.2fx %+3.2f, R\UB2 = %3.2f", 
coef(fit)[2],coef(fit)[1], r2), bty='n', cex=0.7) 

# if you prefer a space between plus/minus and b
b<-coef(fit)[1]
if(b<0) {b_sign='-'; b=-b} else {b_sign= '+'}
 
legend('topright', title='option 2', 
legend=sprintf("y = %3.2f x %s %3.2f, R\UB2 = %3.2f", 
coef(fit)[2],b_sign,b,r2), bty='n',cex=0.7)

Important: R\UB2B2 defined R square symbol. B2 is the hex code for UTF-8 character ² and \U is a control sequence that will call that character.

 
regression1

Decimal places in R plot legend?

For specifying the number of digits, tipically we use the command round, for example:

round(pi, digits=2)

[1] 3.14

However, we can also use sprintf  command to deal with both the number of digits and the + or – in your equation, for example:

sprinf(“%3.2f”,pi)

[1] “3.14”

Note that, 3.2f controls the number of digits and the symbol forces the + or sign in a equation.

 

LaTeX word count: TeXcount

TeXcount is a Perl script for counting words in LaTeX documents. It parses valid LaTeX documents counting words, headers, formulae (mathematics) and floats/begin-end groups.

To run the script, you can either download it and run it on your own computer, or you can use the web interface.


sudo add-apt-repository ppa:staticfloat/juliareleases
sudo add-apt-repository ppa:staticfloat/julia-deps
sudo apt-get update
sudo apt-get install julia
 

Main Journal List

http://www.statsci.org/jourlist.html


The following is a nearly comprehensive list of journals which publish articles in statistics, based on the Current Index to Statistics list of core journals. Note that journal home pages maintained by publishing houses change frequently. If the journal link given here is no longer active, try the NYU Stern journal page.

If you copy this list, please include an acknowledgement of this website and a link back to the original page.

List of statistical packages

Statistical software are specialized computer programs for statistical analysis.

Open source

  • ADaMSoft – a generalized statistical software with Data mining algorithms and methods for data management.
  • ADMB – a software suite for non-linear statistical modeling based on C++ which uses automatic differentiation.
  • Bayesian Filtering Library
  • Chronux – for neurobiological time series data
  • DAP – A free replacement for SAS
  • ELKI a software framework for development of data mining algorithms in Java.
  • Fityk – nonlinear regression software (GUI and command line)
  • gretl – gnu regression, econometrics and time-series Library
  • JAGS – Just another Gibbs sampler (JAGS) is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) developed by Martyn Plummer. It is similar to WinBUGS.
  • JHepWork – Java-based statistical analysis framework for scientists and engineers. It includes an advanced IDE and Jython shell.
  • JMulTi
  • Octave – programming language (very similar to Matlab) with statistical features
  • Mondrian (software) – data analysis tool using interactive statistical graphics with a link to R.
  • OpenBUGS
  • OpenEpi – A web-based, open source, operating-independent series of programs for use in epidemiology and statistics based on JavaScript and HTML
  • OpenMx – A package for Structural equation modeling running in R.
  • Orange, a machine learning and bioinformatics software
  • Ploticus – software for generating a variety of graphs from raw data
  • PSPP – A free software replacement for SPSS
  • R – A free implementation of the S language.
  • R Commander – GUI interface for R\
  • Revolution Analytics – Production-grade software for the enterprise big data analytics
  • RapidMiner, a machine learning toolbox
  • Rattle GUI – GUI interface for R
  • S2[1] – Derived from Salstat, it has a graphical user interface but it can also be scripted by using python, it can make charts as bar chartternary plotBox plot etc. Licenced under GPL3.
  • Salstat – Menu driven statistics software
  • Scilab – uses GPL compatible CeCILL license
  • SciPy (a Python library for scientific computing) contains the stats sub-package which is partly based on the venerable |STAT (a.k.a. PipeStat, formerly UNIX|STAT) software
    • scikit-learn extends SciPy with a host of machine learning models (classification, clustering, regression, etc.)
  • Shogun, an open source Large Scale Machine Learning toolbox that provides several SVM (Support Vector Machine) implementations (like libSVM, SVMlight) under a common framework and interfaces to Octave, Matlab, Python, R
  • Simfit – Simulation, curve fitting, statistics, and plotting
  • SOCR
  • SOFA Statistics – a desktop GUI program focused on ease of use, learn as you go, and beautiful output.
  • Statistical LabR-based and focusing on educational purposes
  • Weka is also a suite of machine learning software written at the University of Waikato.
  • Xlisp-stat

Public domain

Freeware

Proprietary

Add-ons

See also

References

  1. ^ http://code.google.com/p/salstat-statistics-package-2/

External links