Commit 27c365a0 authored by G. Jay Kerns's avatar G. Jay Kerns

added more content to ob-julia-doc.org

parent 2d3d08df
.juliahistory
*~
ols.jl
winston-examples.jl
This diff is collapsed.
No preview for this file type
% Created 2013-02-24 Sun 20:30
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\author{G. Jay Kerns}
\date{\today}
\title{Org-mode and julia: an introduction}
\hypersetup{
pdfkeywords={},
pdfsubject={},
pdfcreator={Generated by Org mode 7.9.3f in Emacs 24.3.50.1.}}
\begin{document}
\maketitle
\tableofcontents
\section[What you need to get started]{What you need to get started}
\label{sec-1}
\begin{verbatim}
(load "~/gitm/projects/ob-julia.el")
(org-babel-julia-initiate-session "*julia*" nil)
\end{verbatim}
\begin{verbatim}
rand(9)
\end{verbatim}
\begin{verbatim}
9-element Float64 Array:
0.627821
0.786056
0.851449
0.447721
0.722442
0.447876
0.578059
0.132425
0.338724
\end{verbatim}
\subsection[Julia]{Julia}
\label{sec-1-1}
\begin{itemize}
\item First install takes the longest, later updates not so bad.
\item all the dependencies
\end{itemize}
\subsection[Add on packages]{Add on packages}
\label{sec-1-2}
Based on \href{http://www.johnmyleswhite.com/notebook/2012/12/02/the-state-of-statistics-in-julia/}{The State of Statistics in Julia} by John Myles White.
\begin{verbatim}
Pkg.add("DataFrames", "Distributions", "MCMC", "Optim", "NHST", "Clustering")
\end{verbatim}
\begin{verbatim}
Pkg.add("RDatasets")
\end{verbatim}
This one is pretty big.
\subsubsection[Winston]{Winston}
\label{sec-1-2-1}
\begin{verbatim}
Pkg.add("Winston")
\end{verbatim}
This one has lots of dependencies.
\subsubsection[Gadfly]{Gadfly}
\label{sec-1-2-2}
\begin{verbatim}
Pkg.add("Gadfly")
\end{verbatim}
\begin{itemize}
\item packages take a lot longer to load than R
\end{itemize}
\subsection[ESS]{ESS}
\label{sec-1-3}
\url{http://stat.ethz.ch/ESS/index.php?Section=download}
\begin{verbatim}
rand(9)
print("hello")
\end{verbatim}
\begin{verbatim}
9-element Float64 Array:
0.294536
0.292205
0.0626337
0.435547
0.830883
0.298874
0.286572
0.539265
0.855514
hello
\end{verbatim}
\begin{verbatim}
(add-to-list 'load-path "~/path/to/ESS/lisp")
(require 'ess-site)
\end{verbatim}
\subsection[Org-mode]{Org-mode}
\label{sec-1-4}
\begin{verbatim}
(setq inferior-julia-program-name "~/path/to/julia-release-basic")
\end{verbatim}
\begin{verbatim}
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(julia . t)))
\end{verbatim}
For inline image display
\begin{verbatim}
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images)
(add-hook 'org-mode-hook 'org-display-inline-images)
\end{verbatim}
\section[Getting started]{Getting started}
\label{sec-2}
\begin{verbatim}
[3:50]
x = [3:6]
y = [5:11]
z = [4:7]
x + z
ans
sum(x)
mean(x)
exp(x)
log(x)
sort(x)
sqrt(x)
diff(x)
x[3]
y[2:4]
typeof(x)
1.0
1.
Inf
-Inf
NaN
true
false
1 + 2im
\end{verbatim}
\section[Plotting with Winston]{Plotting with Winston}
\label{sec-3}
\begin{verbatim}
using Winston
x = linspace( 0, 3pi, 100 )
c = cos(x)
s = sin(x)
p = FramedPlot();
setattr(p, "title", "title!")
setattr(p, "xlabel", L"\Sigma x^2_i")
setattr(p, "ylabel", L"\Theta_i")
add(p, FillBetween(x, c, x, s) )
add(p, Curve(x, c, "color", "red") )
add(p, Curve(x, s, "color", "blue") )
file(p, "blah2.png")
\end{verbatim}
\includegraphics[width=.9\linewidth]{blah2.png}
\section[Plotting with Gadfly]{Plotting with Gadfly}
\label{sec-4}
\begin{verbatim}
using RDatasets
using Gadfly
using Compose
iris = data("datasets", "iris")
p = plot(iris, {:x => "Sepal.Length", :y => "Sepal.Width"}, Geom.point);
SVG("iris_plot.svg", 6inch, 4inch)
\end{verbatim}
\section[Fitting linear models]{Fitting linear models}
\label{sec-5}
% Generated by Org mode 7.9.3f in Emacs 24.3.50.1.
\end{document}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment