-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcalls.tex
34 lines (31 loc) · 1.26 KB
/
calls.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
\documentclass{article}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage{cprotect}
\usepackage{fullpage}
\usepackage[margin=0.5in]{geometry}
\begin{document}
%\begin{tikzpicture}
%\draw (0,2) rectangle (2, 4);
%\draw[blue] (1.8,2.2) rectangle (4, 2);
%\draw[red] (4,4) rectangle (6, 0);
%\end{tikzpicture}
%{\Large \textbf{$>$ scatter.smooth(mtcars[ , c(1, 2)])}};
\begin{figure}
\input{calls_fig}
\cprotect\caption[The Call Stack, Call Frames and their Search Paths]{\textbf{The Call Stack, Call Frames and their Search Paths.}
This shows the call stack for \verb!scatter.smooth(mtcars[, c(1, 2)])!.
scatter.smooth() calls xy.coords() and finally the argument for x in
scatter.smooth is needed. Due to R's lazy evaluation, this is evaluated next,
hence the call the \verb![(mtcars, c(1, 2))!.
Within each of the three call frames,
R searches for symbols by looking first in the
call frame and then in its parent environment, and its parent environment,
and so on.
These environments are displayed moving from left to right and show
the search through packages and their imports and their parents.
Afer \verb|R_GlobalEnv|, the search continues along the regular search path,
i.e., the packages loaded on the seach path via require() and library().
}
\end{figure}
\end{document}