#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass scrbook
\begin_preamble
\input{preamble.tex}
\end_preamble
\use_default_options false
\language english
\inputencoding utf8
\font_roman lmodern
\font_sans helvet
\font_typewriter courier
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\float_placement H
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\papersize letterpaper
\use_geometry false
\use_amsmath 2
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 0 5 11 -1
\bullet 1 5 24 -1
\bullet 2 0 0 -1
\tracking_changes false
\output_changes false
\author ""
\author ""
\end_header
\begin_body
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
input{chapter.tex}
\end_layout
\end_inset
\end_layout
\begin_layout Chapter
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
,
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
, and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
-- Linux
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
epigraph{An education isn't how much you have committed to memory, or even
how much you know.
It's being able to differentiate between what you know and what you don't.}{Fran
çois-Anatole Thibault}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
This chapter lists instructions for a functioning
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
environment.
\end_layout
\begin_layout Standard
In this chapter:
\end_layout
\begin_layout Itemize
\series bold
Prerequisites.
\series default
Lists the software packages required to begin the installation.
\end_layout
\begin_layout Itemize
\series bold
Installation.
\series default
Enumerates the steps for installing
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Itemize
\series bold
Configuration.
\series default
Describes how to ready
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
for integration with
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Itemize
\series bold
Validation.
\series default
Verifies that
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
code can be called from within
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Section
Prerequisites
\end_layout
\begin_layout Standard
Before the instructions in this chapter can be executed successfully,
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
must be installed and fully functional.
\end_layout
\begin_layout Section
Installation
\end_layout
\begin_layout Standard
This section describes how to install
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Subsection
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
To install
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
type:
\end_layout
\begin_layout LyX-Code
sudo aptitude install r-base-core r-base-dev
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
is installed.
\end_layout
\begin_layout Subsection
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
To install
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
type:
\end_layout
\begin_layout LyX-Code
sudo aptitude install postgresql-plr
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
is installed.
\end_layout
\begin_layout Section
Configuration
\end_layout
\begin_layout Standard
This section describes how to configure
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
.
\end_layout
\begin_layout Subsection
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
After you have installed
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
, upgrade all
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
packages to the latest version as follows:
\end_layout
\begin_layout Enumerate
Open a terminal window.
\end_layout
\begin_layout Enumerate
Start
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
type:
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
In Linux, command names are case sensitive.
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout LyX-Code
sudo su - -c R
\end_layout
\end_deeper
\begin_layout Enumerate
Type:
\end_layout
\begin_deeper
\begin_layout LyX-Code
\family typewriter
update.packages()
\end_layout
\end_deeper
\begin_layout Enumerate
Select the mirror closest to your location.
\end_layout
\begin_layout Enumerate
Click
\series bold
OK
\series default
or press
\series bold
Enter
\series default
if in console mode.
\end_layout
\begin_layout Enumerate
If prompted, type
\family typewriter
Y
\family default
at each prompt to upgrade the package.
\end_layout
\begin_layout Enumerate
Type the following to quit
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
:
\end_layout
\begin_deeper
\begin_layout LyX-Code
q()
\end_layout
\end_deeper
\begin_layout Enumerate
When prompted to
\series bold
Save workspace image
\series default
, type:
\end_layout
\begin_deeper
\begin_layout LyX-Code
\family typewriter
n
\end_layout
\end_deeper
\begin_layout Enumerate
Restart the database.
For
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
, type:
\end_layout
\begin_deeper
\begin_layout LyX-Code
/etc/init.d/postgresql restart
\end_layout
\end_deeper
\begin_layout Enumerate
Logout of the
\family typewriter
root
\family default
account.
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
is configured.
\end_layout
\begin_layout Subsection
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
To configure
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
:
\end_layout
\begin_layout Enumerate
Open a terminal window.
\end_layout
\begin_layout Enumerate
Type:
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
Be sure to substitute the appropriate
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
version number and the correct username, if it differs from
\family typewriter
\size normal
postgres
\family default
\size default
.
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout LyX-Code
\size small
psql -W -U postgres < /usr/share/postgresql/8.4/plr.sql
\end_layout
\end_deeper
\begin_layout Enumerate
Type the postgres user's password when prompted.
\end_layout
\begin_deeper
\begin_layout Standard
Note: The password will be displayed on the screen.
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
is configured.
\end_layout
\begin_layout Section
Validation
\end_layout
\begin_layout Standard
To test that
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
is installed correctly:
\end_layout
\begin_layout Enumerate
Open a terminal window.
\end_layout
\begin_layout Enumerate
Start the
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
Administration tool (
\series bold
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppgadmin{}
\end_layout
\end_inset
\series default
), type:
\end_layout
\begin_deeper
\begin_layout LyX-Code
pgadmin3
\end_layout
\end_deeper
\begin_layout Enumerate
Right-click on
\series bold
PostgreSQL 8.4
\series default
.
\end_layout
\begin_layout Enumerate
Select connect.
\end_layout
\begin_layout Enumerate
Type in the postgres user password when prompted.
\end_layout
\begin_layout Enumerate
Click
\series bold
OK
\series default
.
\end_layout
\begin_layout Enumerate
Expand
\series bold
PostgreSQL
\begin_inset Quotes ald
\end_inset
Databases
\begin_inset Quotes ald
\end_inset
postgres
\series default
.
\end_layout
\begin_layout Enumerate
Click
\series bold
postgres
\series default
to highlight it.
\end_layout
\begin_layout Enumerate
Click the
\series bold
Execute arbitrary SQL queries
\series default
icon.
\end_layout
\begin_layout Enumerate
Press
\series bold
CTRL-a
\series default
to highlight, and subsequently replace, any existing text.
\end_layout
\begin_layout Enumerate
Type:
\end_layout
\begin_deeper
\begin_layout Standard
\family typewriter
SELECT * FROM plr_environ()
\end_layout
\end_deeper
\begin_layout Enumerate
Press
\series bold
F5
\series default
to execute the query.
\end_layout
\begin_layout Standard
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
environment variables appear as a list of key-value pairs.
\end_layout
\begin_layout Section
Summary
\end_layout
\begin_layout Standard
The quote from Marie Curie-Skłodowska, a generous and accomplished physicist
and chemist, captures the essence of passion that motivates software developers
to imagine ways to help each other and the world.
Linux is free, Apache software is free,
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
is free,
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
is free, and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appjasperreports{}
\end_layout
\end_inset
is free.
The visionaries of these projects have helped shape the world in unimaginable
ways; whether through efficient presentation of data, expedient and resilient
storage of data, or opening the world's eyes to the perils of proprietary
data formats.
\end_layout
\begin_layout Standard
Poet and novelist François-Anatole Thibault reveals an interesting starting
point about learning in his quote.
Much of our primary education concerns itself with rote memorization regarding
what is known or agreed upon: spelling, history, geography, and formulae.
Meaningful understanding, though, begins when we acquire tools to explore
the
\emph on
un
\emph default
known.
The combination of
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appr{}
\end_layout
\end_inset
and
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
apppostgres{}
\end_layout
\end_inset
(connected together using
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
appplr{}
\end_layout
\end_inset
) creates an analysis tool for data mining.
This allows people to confirm what they already suspect and ask questions
of the data to learn what they do not know.
\end_layout
\end_body
\end_document