Skip to content

Commit

Permalink
Revise index correcting bad entries
Browse files Browse the repository at this point in the history
Correct various wrong, missing and misplaced index entries.
  • Loading branch information
aphalo committed Aug 2, 2019
1 parent 1588703 commit 89a7ea2
Show file tree
Hide file tree
Showing 24 changed files with 254,882 additions and 258,871 deletions.
9 changes: 5 additions & 4 deletions R.as.calculator.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ a + b
a - a
@

As it can be seen in the first line above, another peculiarity of \Rpgrm, is what is frequently called ``recycling'' of arguments:\index{recycling@recycling of arguments} as vector \code{a} is of length 6, but the constant 1 is a vector of length 1, this 1 is extended by recycling into a vector of ones of the same length as the longest vector in the statement, in this case, \code{a}.\label{par:recycling:numeric}
As it can be seen in the first line above, another peculiarity of \Rpgrm, is what is frequently called ``recycling'' of arguments:\index{recycling of arguments} as vector \code{a} is of length 6, but the constant 1 is a vector of length 1, this 1 is extended by recycling into a vector of ones of the same length as the longest vector in the statement, in this case, \code{a}.\label{par:recycling:numeric}

Make sure you understand what calculations are taking place in the chunk above, and also the one below.

Expand Down Expand Up @@ -503,7 +503,8 @@ any(c > 20, na.rm=TRUE)
@

\begin{explainbox}
\label{box:floats} \label{par:float}\index{floating point numbers!arithmetic|(}\index{machine arithmetic!precision|(}
\label{box:floats} \label{par:float}
\index{floating point numbers!arithmetic|(}\index{machine arithmetic!precision|(}
\index{floats|see{floating point numbers}}\index{machine arithmetic!rounding errors}\index{Real numbers and computers}
\index{EPS ($\epsilon$)|see{machine arithmetic precision}}%
You may skip this box on first reading. See also page \pageref{par:float}. Here I give some examples for which the finite resolution of computer machine floats, as compared to Real numbers as defined in mathematics makes an important difference.
Expand Down Expand Up @@ -548,7 +549,7 @@ As \Rclass{integer} values are stored in machine memory without loss of precisio
2147483699L
@

In those statements in the chunk below where at least one operand is \Rclass{double} the \Rclass{integer} operands are \emph{promoted} to \Rclass{double} before computation. A similar promotion does not take place when operations are among \Rclass{integer} values, resulting in \emph{overflow}\index{arithmetic overflow}\index{overflow!see{arithmetic overflow}}, meaning numbers that are too big to be represented as \Rclass{integer} values.
In those statements in the chunk below where at least one operand is \Rclass{double} the \Rclass{integer} operands are \emph{promoted} to \Rclass{double} before computation. A similar promotion does not take place when operations are among \Rclass{integer} values, resulting in \emph{overflow}\index{arithmetic overflow}\index{overflow|see{arithmetic overflow}}, meaning numbers that are too big to be represented as \Rclass{integer} values.

<<machine-eps-04>>=
2147483600L + 99L
Expand Down Expand Up @@ -1965,7 +1966,7 @@ Obtain the summary of \code{airquality} with function \Rfunction{summary()}, but

\section{Plotting}
\index{plots!base R graphics}
Base \Rlang generic method \Rfunction{plot()} can be used to plot different data. It is a generic method that has specializations suitable for different kinds of objects (see section \ref{sec:script:objects:classes:methods} on page \pageref{sec:script:objects:classes:methods} for a brief introduction to objects, classes and methods). In this section we only very briefly demonstrate the use of the most common base \langname{R}'s graphics functions. They are well described in the book \citebooktitle{Murrell2011} \autocite{Murrell2011}. We will not describe the Lattice (based on S's Trellis) approach to plotting \autocite{Sarkar2008}. Instead we describe in detail the use of the \emph{grammar of graphics} and plotting with package \ggplot in chapter \ref{chap:R:plotting} starting on page \pageref{chap:R:plotting}.
Base \Rlang generic method \Rfunction{plot()} can be used to plot different data. It is a generic method that has specializations suitable for different kinds of objects (see section \ref{sec:script:objects:classes:methods} on page \pageref{sec:script:objects:classes:methods} for a brief introduction to objects, classes and methods). In this section we only very briefly demonstrate the use of the most common base \Rlang's graphics functions. They are well described in the book \citebooktitle{Murrell2011} \autocite{Murrell2011}. We will not describe the Lattice (based on S's Trellis) approach to plotting \autocite{Sarkar2008}. Instead we describe in detail the use of the \emph{grammar of graphics} and plotting with package \ggplot in chapter \ref{chap:R:plotting} starting on page \pageref{chap:R:plotting}.

It is possible to pass two variables (here columns from a data frame) directly as arguments to the \code{x} and \code{y} parameters of \Rfunction{plot()}.

Expand Down
73 changes: 48 additions & 25 deletions R.data.Rnw

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions R.data.io.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ cat(readLines('my-file2.txt'), sep = '\n')
\subsection[readr]{\pkgname{readr}}\label{sec:files:readr}
\index{importing data!text files|(}

<<>>=
<<eval=FALSE, include=FALSE>>=
citation(package = "readr")
@

Expand Down Expand Up @@ -468,7 +468,7 @@ XML files contain text with special markup. Several modern data exchange formats

\subsection['xml2']{\pkgname{xml2}}

<<xml2-00>>=
<<xml2-00, eval=FALSE, include=FALSE>>=
citation(package = "xml2")
@

Expand Down Expand Up @@ -502,7 +502,7 @@ If we have access to the original software used for creating a worksheet or work
\subsection['readxl']{\pkgname{readxl}}\label{sec:files:excel}
\index{importing data!.xlsx files|(}

<<readxl-00>>=
<<readxl-00, eval=FALSE, include=FALSE>>=
citation(package = "readxl")
@

Expand Down Expand Up @@ -537,7 +537,7 @@ Of the remaining arguments, the most useful ones have the same names and play si

\subsection['xlsx']{\pkgname{xlsx}}

<<xlsx-00>>=
<<xlsx-00, eval=FALSE, include=FALSE>>=
citation(package = "xlsx")
@

Expand Down Expand Up @@ -590,7 +590,7 @@ There are two different comprehensive packages for importing data saved from oth

\subsection[foreign]{\pkgname{foreign}}

<<foreign-00>>=
<<foreign-00, eval=FALSE, include=FALSE>>=
citation(package = "foreign")
@

Expand Down Expand Up @@ -619,7 +619,7 @@ The functions in \pkgname{foreign} can return data frames, but not always this i

\subsection[haven]{\pkgname{haven}}

<<haven-00>>=
<<haven-00, eval=FALSE, include=FALSE>>=
citation(package = "haven")
@

Expand Down Expand Up @@ -666,7 +666,7 @@ As sometimes \pgrmname{NetCDF} files are large, it is good that it is possible t

\subsection[ncdf4]{\pkgname{ncdf4}}

<<ncdf4-00>>=
<<ncdf4-00, eval=FALSE, include=FALSE>>=
citation(package = "ncdf4")
@

Expand Down Expand Up @@ -715,7 +715,7 @@ If we want to read in several grid points, we can use several different approach

\subsection[tidync]{\pkgname{tidync}}

<<tidync-00>>=
<<tidync-00, eval=FALSE, include=FALSE>>=
citation(package = "tidync")
@

Expand Down Expand Up @@ -836,7 +836,7 @@ Numerous\index{internet-of-things} modern data acquisition devices based on micr

\subsection[jsonlite]{\pkgname{jsonlite}}

<<iot-00>>=
<<iot-00, eval=FALSE, include=FALSE>>=
citation(package = "jsonlite")
@

Expand Down Expand Up @@ -876,13 +876,13 @@ The minimum, mean and maximum values for each logging interval, need to be split

\section{Databases}\label{sec:data:db}
\index{importing data!databases|(}
<<dbplyr-00a>>=
<<dbplyr-00a, eval=FALSE, include=FALSE>>=
citation(package = "dbplyr")
@
<<dbplyr-00b>>=
<<dbplyr-00b, eval=FALSE, include=FALSE>>=
citation(package = "DBI")
@
<<dbplyr-00c>>=
<<dbplyr-00c, eval=FALSE, include=FALSE>>=
citation(package = "RSQLite")
@

Expand All @@ -897,7 +897,7 @@ copy_to(con, weather_wk_25_2019.tb, "weather",
temporary = FALSE,
indexes = list(
c("month_name", "calendar_year", "solar_time"),
"time",
"time",
"sun_elevation",
"was_sunny",
"day_of_year",
Expand All @@ -906,7 +906,7 @@ copy_to(con, weather_wk_25_2019.tb, "weather",
)
weather.db <- tbl(con, "weather")
colnames(weather.db)
weather.db %.>%
weather.db %.>%
filter(., sun_elevation > 5) %.>%
group_by(., day_of_year) %.>%
summarise(., energy_Wh = sum(global_watt, na.rm = TRUE) * 60 / 3600)
Expand Down
Loading

0 comments on commit 89a7ea2

Please sign in to comment.