Git Computer Commands

A list that I wrote for myself to remember the order of git commands to be executed in a terminal window. In others words what do I type first, then second.
git comes first. It is git something not something git.
Open a terminal window. CD to the folder you want to be in.
git init
git clone
git status (I have found it a good idea to type git status after every git command.)
git add
git log
git remote
git push
git checkout
git pull
What the commands are and do can be looked up on github.

Linear Algebra


Linear algebra book written by Peter Petersen published by Springer Publisher.

This book takes a different approach in presenting linear algebra.  It has five long chapter with lots of sections. Explains using  geometric drawings.

Chapter 1.13 does Gaussian elimination.

Chapter 2 is on Linear Operations. Covers  linear differential equations. Eigenvalues including a definition of the German word eigen.  Uses Gaussian elimination instead of determinants to find eigenvalues.

2.5 shows diagonalizability with Fibonacci Sequence as an example.

Chapter 3 is on inner product spaces. Including Quaternions, Cauchy-Schwarz, Triangle Inequality, OR Factorization, and Matrix Exponentials.

Chapter 4 covers Linear Operations on Inner Products. Including Polarization and Isometrics,. 4.3 is about Spectral Theorem.

4.9 Singular Value Decomposition.

Chapter 5 is on determinants. Using a geometric approach then an Algebraic approach.  Then uses the theory applied to the study of linear differential equations.



Linear Algebra and Linear Models


Written by R.B. Bapat, published by Springer Publishing.

A Math Book. Not a code book. Sometimes it is useful to read a Math book. Reading a Math book helps you understand what went wrong with your code when all the syntax is correct but the results are a little strange. Knowing the math behind the code helps to figure out what is going on.
Complete with proofs this book on Linear Algebra covers a lot of material.
The proofs are useful in helping understand the language and why its used in Linear Algebra.

Chapter One covers the preliminaries of Linear Algebra. Covers basis and dimension, dim.
Chapter two covers rank, nonsingulars and Frobenuis Inequality.
Chapter three covers eigenvalues for the first time. In addition

Chapter five covers eigenvalues.
Chapter four covers generalized inverses, including Moore-Penrose inverse.

Chapter seven covers General Linear Model, GLM.
Chapter eight tests of linear hypothesis. Cochran’s Theory. A nice table on ANOVA 8.1

Chapter nine Linear Mixed Models.


Guide to Programming and Algorithms using R


Good book of useful algorithms programmed using R.

Written by Ozgur Ergul, published by Springer Publishing 2013.

I like how the book starts with cooking an omelette as an example of algorithm development.

Chapter 3.2.3 covers the Towers of Hanoi with detailed instructions and R code.

Chapter 4.5.1 is about the Traveling Salesman problem.

Chapter 6 has various sorting algorithms, Bubble sort, Insertion sort, and Quick sort. Table 6.1 is a comparison of the sorting methods.

Now I don’t have to figure out how to turn JAVA code into R code.

Chapter 7 has solutions of  linear systems of equations. Gaussian elimination, LU Factorization, Pivoting, Cholesky Factorization, and Gauss-Jordan elimination.

The book goes on with more useful information of file Processing.

Text Analysis with R for Students of Literature


text9783319031637Text Analysis with R for Students of Literature by Matthew L. Jockers, published by Springer.

This is a well written book on the topic of Text Analysis.  There is enough information to give you a good start using R.  Followed by easy to understand details about text analysis.

Covered in Chapter 6 type token ratio, TTR.

Chapter 7 hapex legomena, words that appear in frequency.

Chapter 8, KWIC Key word context. Including how to make a corpus.

Chapter 11, covers clustering. Chapter 12, classification Shows how to do crosstabs with xtabs function. Also SVM support Vector Machine.

Chapter 13 covers topic modeling.

This is a good book to have if you are doing text analysis.


Solving Differential Equations in R



Solving Differential Equations in R
by Karline Soetaert, Jeff Cash and Francesca Mazzia
Published by Springer Press

The books’ package on CRAN is diffEq.

I happily read through this book on a Sunday afternoon. It is a straight forward book to use if you already understand differential equations and can program in R.  If either topic is new to you , learn them first then tackle this book.

It is much easier to code Euler’s and Newton’s method in R than the C and FORTRAN the code I originally used for these methods.

My favorite bit of code is the Elastica Problem in Chapter 11. The problem is a system of five differential equations describing an elastica in the x,y plane. Uses package bvpSolve. The package for solving boundary value problems.

Figure 2.4 page 37 is a nice chart of the main Families of IVP, Initial Value Problems solutions.

This book gives you the tools you need to solve differential equations in R.


An Introduction to Statistical Learning


with Applications in R
Series: Springer Texts in Statistics, Vol. 103
James, G., Witten, D., Hastie, T., Tibshirani, R.

The stated purpose of this book is to facilitate the transition of statistical learning to mainstream. To achieve this the book has it’s own website  The website includes the R code for the book. The R package for the book is ISLR, which includes the data used in the book.

Introduction to Statistical learning does not replace Elements of Statistical Learning.  Instead it adds information by including more detail and R code to some of the topics in Elements of Statistical Learning.

The labs in the book are self contained and the code for them is on the website under the chapter headings.

Chapter 2.1.5 covers regression versus classification problems with good explanations  on what techniques to use for different types of data.

Good discussion on how use K-Nearest Neighbor, a non-parametric method.

Chapter 3.3.3 Potential Problems, covers common issues in fitting a linear regression model.

Chapter 7 covers splines in great detail. Then chapter 7 goes over Generalized Additive Models, GAM.

I am having a lot of fun playing with the code that goes with book.  I am glad that this was written.


I enjoy object oriented programming. How I can turn something into an object then do things with it, apply methods and other useful things with out explicitly typing long line of code like FORTRAN.
The other day I made a coding mistake in R.
example Take a data frame called dogfood and turn it into an object.
dog <- data(dogfood)

The correct way is:
dog <- data.frame(dogfood)

Upside down Bonnie to remind me not to forget part of the code



Plots and Graphs Atributes

Plots and Graphs in R have lots of methods and arguments. Here are the basics.
argument, meaning
type,   type of plot
main, main title
sub,    subtitle

xlab,   label for x axis
ylab,    label for y axis

asp,    aspect yx ratio


parameter ,  description
col ,    color names, values, numbers, hex values

border, colour value
lwd ,   line width,value is a  number
lty ,     line type, value is a number
pch,    point symbol, value is a number
las,     style of axis labels

bg,     background fill color
cex,    magnifying ratio, number( 1 default)


Point symbol numbers are in the help file.

colors, I am amazed at the variety of color s available. Hex numbers work. RColorBrewer adds even more like palettes.