Skip to content

Commit

Permalink
First proofreading pass to Ch 3
Browse files Browse the repository at this point in the history
Updated to krantz.cls to that received today from Kumar Shashi
  • Loading branch information
aphalo committed Sep 5, 2023
1 parent da8f893 commit 8db7729
Show file tree
Hide file tree
Showing 25 changed files with 355,645 additions and 354,105 deletions.
Binary file added CRC-2nd-ed/krantz.cls.zip
Binary file not shown.
276 changes: 148 additions & 128 deletions R.as.calculator.Rnw

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions R.intro.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ opts_knit$set(unnamed.chunk.label = 'intro-chunk')
opts_knit$set(concordance=TRUE)
@

\chapter{R: the language and the program}\label{chap:R:introduction}
\chapter{R: the Language and the Program}\label{chap:R:introduction}

\begin{VF}
In a world of \ldots\ relentless pressure for more of everything, one can lose sight of the basic principles---simplicity, clarity, generality---that form the bedrock of good software.
Expand Down Expand Up @@ -197,7 +197,7 @@ Although the use of these tools is very important, they are outside the scope of

\section{Getting ready to use \Rlang}\label{sec:R:install}

As the book is designed with the expectation that readers will run code examples as the read the text, you have to ensure access to the \Rpgrm before reading the next chapter. It is likely that your school, employer or teacher has already enabled access to \Rpgrm. If not, or if you are reading the book on your own, you should install \Rpgrm or secure access to an on-line service. Using \RStudio or another IDE can facilitate the use of \Rpgrm, but all the code in the remaining chapters makes only use of \Rpgrm and packages available through CRAN. Chapters
As the book is designed with the expectation that readers will run code examples as the read the text, you have to ensure access to the \Rpgrm before reading the next chapter. It is likely that your school, employer or teacher has already enabled access to \Rpgrm. If not, or if you are reading the book on your own, you should install \Rpgrm or secure access to an on-line service. Using \RStudio or another IDE can facilitate the use of \Rpgrm, but all the code in the remaining chapters makes only use of \Rpgrm and packages available through CRAN. Chapters

I have written an \Rlang package, named \pkgname{learnrbook}, containing original data and computer-readable listings for all code examples and exercises in the book. It also contains code and data that makes it easier to instal the packages used in later chapters. Its name is \pkgname{learnrbook} and is available through CRAN. \textbf{It is not necessary for you to install this or any other packages until section \ref{sec:packages:install} on page \pageref{sec:packages:install}, where I explain how to install and use \Rlang \Rlang packages.}

Expand Down
16 changes: 8 additions & 8 deletions appendixes.prj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
using-r-main-crc.Rnw
18
15
9
1

using-r-main-crc.Rnw
TeX:RNW:UTF-8
134217730 0 185 13 165 2 6074 -1 6458 208 1 1 162 4125 1 906 254 255 -1 0 0 33 1 0 2 165 0 -1 0
134217730 0 80 1 58 28 6074 -1 6458 208 1 1 526 100 1 906 254 255 -1 0 0 33 1 0 28 58 0 -1 0
R.intro.Rnw
TeX:RNW
17838075 0 -1 4459 -1 185 228 228 1214 1286 1 1 162 150 -1 -1 0 0 30 -1 -1 30 1 0 185 -1 0 -1 0
286273531 0 -1 222 -1 1933 228 228 1214 1286 1 1 148 550 -1 -1 0 0 30 -1 -1 30 1 0 1933 -1 0 -1 0
preface.Rnw
TeX:RNW
1060859 0 -1 5954 -1 7617 266 266 1252 1324 1 1 1604 650 -1 -1 0 0 18 -1 -1 18 1 0 7617 -1 0 -1 0
Expand All @@ -22,7 +22,7 @@ TeX:RNW
17838075 0 -1 8884 -1 8852 304 304 1290 1362 1 1 1030 150 -1 -1 0 0 40 -1 -1 40 1 0 8852 -1 0 -1 0
R.as.calculator.Rnw
TeX:RNW
17838075 0 -1 20138 -1 20080 190 190 1324 1242 1 1 148 475 -1 -1 0 0 31 -1 -1 31 3 0 20080 -1 1 100329 -1 2 16144 -1 0 -1 0
17838075 0 -1 76298 -1 76378 190 190 1324 1242 1 1 614 700 -1 -1 0 0 31 -1 -1 31 3 0 76378 -1 1 101866 -1 2 16032 -1 0 -1 0
R.data.containers.Rnw
TeX:RNW
17838075 0 -1 55106 -1 55112 190 190 1324 1242 1 1 1002 700 -1 -1 0 0 31 -1 -1 31 3 0 55112 -1 1 192 -1 2 192 -1 0 -1 0
Expand All @@ -31,19 +31,19 @@ TeX:RNW
17838075 1 -1 27645 -1 27673 456 456 1442 1484 1 1 1184 1050 -1 -1 0 0 31 -1 -1 31 1 0 27673 -1 0 -1 0
R.scripts.Rnw
TeX:RNW
17838075 0 -1 69024 -1 69024 152 152 1138 1210 1 1 316 575 -1 -1 0 0 31 -1 -1 31 2 0 69024 -1 1 57446 -1 0 -1 0
17838075 1 -1 26524 -1 26540 152 152 1138 1210 1 1 769 225 -1 -1 0 0 31 -1 -1 31 2 0 26540 -1 1 57446 -1 0 -1 0
R.stats.rnw
TeX:RNW
17838075 2 -1 11697 -1 11700 418 418 1404 1476 1 1 330 800 -1 -1 0 0 31 -1 -1 31 1 0 11700 -1 0 -1 0
R.plotting.Rnw
TeX:RNW
286273531 0 -1 203095 -1 203119 380 380 1366 1438 1 1 148 1675 -1 -1 0 0 31 -1 -1 31 1 0 203119 -1 0 -1 0
17838075 2 -1 170354 -1 170361 380 380 1366 1438 1 1 400 475 -1 -1 0 0 31 -1 -1 31 1 0 170361 -1 0 -1 0
R.data.Rnw
TeX:RNW
1060859 0 -1 51366 -1 51369 342 342 1328 1400 1 1 330 475 -1 -1 0 0 31 -1 -1 31 1 0 51369 -1 0 -1 0
references.bib
BibTeX
1049586 0 122 22 113 22 76 76 1467 997 1 1 442 2825 -1 -1 0 0 23 0 0 23 1 0 22 113 0 -1 0
1049586 0 122 22 113 22 76 76 1467 997 1 1 442 1275 -1 -1 0 0 23 0 0 23 1 0 22 113 0 -1 0
R.data.io.Rnw
TeX:RNW
17838075 0 -1 12807 -1 12806 494 494 1480 1522 1 1 414 525 -1 -1 0 0 31 -1 -1 31 1 0 12806 -1 0 -1 0
Expand All @@ -52,7 +52,7 @@ BibTeX
1049586 0 667 7 909 1 38 38 1429 959 1 1 148 1300 -1 -1 0 0 21 0 0 21 1 0 1 909 0 -1 0
usingr.sty
TeX:STY
1060850 1 93 13 93 24 190 190 1176 1248 1 0 451 950 -1 -1 0 0 25 0 0 25 1 0 24 93 0 0 0
1060850 0 93 13 96 28 190 190 1176 1248 1 0 507 375 -1 -1 0 0 25 0 0 25 1 0 28 96 0 0 0
using-r-main-crc.tex
TeX
269496315 0 -1 1171552 -1 1170927 130 130 919 707 1 1 316 575 -1 -1 0 0 49 -1 -1 49 1 0 1170927 -1 0 -1 0
Expand Down
18 changes: 9 additions & 9 deletions appendixes.prj.bak
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
using-r-main-crc.Rnw
18
15
10
4

using-r-main-crc.Rnw
TeX:RNW:UTF-8
134217730 0 185 13 165 2 6074 -1 6458 208 1 1 162 4125 1 906 254 255 -1 0 0 33 1 0 2 165 0 -1 0
134217730 0 80 1 58 28 6074 -1 6458 208 1 1 526 100 1 906 254 255 -1 0 0 33 1 0 28 58 0 -1 0
R.intro.Rnw
TeX:RNW
17838075 0 -1 4459 -1 185 228 228 1214 1286 1 1 162 150 -1 -1 0 0 30 -1 -1 30 1 0 185 -1 0 -1 0
Expand All @@ -22,7 +22,7 @@ TeX:RNW
17838075 0 -1 8884 -1 8852 304 304 1290 1362 1 1 1030 150 -1 -1 0 0 40 -1 -1 40 1 0 8852 -1 0 -1 0
R.as.calculator.Rnw
TeX:RNW
17838075 0 -1 20138 -1 20080 190 190 1324 1242 1 1 148 475 -1 -1 0 0 31 -1 -1 31 3 0 20080 -1 1 100329 -1 2 16144 -1 0 -1 0
286273531 0 -1 76298 -1 76378 190 190 1324 1242 1 1 614 700 -1 -1 0 0 31 -1 -1 31 3 0 76378 -1 1 101866 -1 2 16032 -1 0 -1 0
R.data.containers.Rnw
TeX:RNW
17838075 0 -1 55106 -1 55112 190 190 1324 1242 1 1 1002 700 -1 -1 0 0 31 -1 -1 31 3 0 55112 -1 1 192 -1 2 192 -1 0 -1 0
Expand All @@ -31,19 +31,19 @@ TeX:RNW
17838075 1 -1 27645 -1 27673 456 456 1442 1484 1 1 1184 1050 -1 -1 0 0 31 -1 -1 31 1 0 27673 -1 0 -1 0
R.scripts.Rnw
TeX:RNW
17838075 0 -1 69024 -1 69024 152 152 1138 1210 1 1 316 575 -1 -1 0 0 31 -1 -1 31 2 0 69024 -1 1 57446 -1 0 -1 0
17838075 1 -1 26524 -1 26540 152 152 1138 1210 1 1 769 225 -1 -1 0 0 31 -1 -1 31 2 0 26540 -1 1 57446 -1 0 -1 0
R.stats.rnw
TeX:RNW
17838075 2 -1 11697 -1 11700 418 418 1404 1476 1 1 330 800 -1 -1 0 0 31 -1 -1 31 1 0 11700 -1 0 -1 0
R.plotting.Rnw
TeX:RNW
17838075 2 -1 158228 -1 158231 380 380 1366 1438 1 1 946 650 -1 -1 0 0 31 -1 -1 31 1 0 158231 -1 0 -1 0
17838075 2 -1 170354 -1 170361 380 380 1366 1438 1 1 400 475 -1 -1 0 0 31 -1 -1 31 1 0 170361 -1 0 -1 0
R.data.Rnw
TeX:RNW
269496315 0 -1 51366 -1 51369 342 342 1328 1400 1 1 330 475 -1 -1 0 0 31 -1 -1 31 1 0 51369 -1 0 -1 0
1060859 0 -1 51366 -1 51369 342 342 1328 1400 1 1 330 475 -1 -1 0 0 31 -1 -1 31 1 0 51369 -1 0 -1 0
references.bib
BibTeX
1049586 0 122 22 113 22 76 76 1467 997 1 1 442 2825 -1 -1 0 0 23 0 0 23 1 0 22 113 0 -1 0
1049586 0 122 22 113 22 76 76 1467 997 1 1 442 1275 -1 -1 0 0 23 0 0 23 1 0 22 113 0 -1 0
R.data.io.Rnw
TeX:RNW
17838075 0 -1 12807 -1 12806 494 494 1480 1522 1 1 414 525 -1 -1 0 0 31 -1 -1 31 1 0 12806 -1 0 -1 0
Expand All @@ -52,10 +52,10 @@ BibTeX
1049586 0 667 7 909 1 38 38 1429 959 1 1 148 1300 -1 -1 0 0 21 0 0 21 1 0 1 909 0 -1 0
usingr.sty
TeX:STY
1060850 1 93 13 93 24 190 190 1176 1248 1 0 451 950 -1 -1 0 0 25 0 0 25 1 0 24 93 0 0 0
1060850 0 93 13 96 28 190 190 1176 1248 1 0 507 375 -1 -1 0 0 25 0 0 25 1 0 28 96 0 0 0
using-r-main-crc.tex
TeX
269496315 2 -1 27784 -1 27786 130 130 919 707 1 1 176 225 -1 -1 0 0 49 -1 -1 49 1 0 27786 -1 0 -1 0
269496315 0 -1 1171552 -1 1170927 130 130 919 707 1 1 316 575 -1 -1 0 0 49 -1 -1 49 1 0 1170927 -1 0 -1 0
krantz.cls
TeX:STY:UNIX
269594610 1 1082 1 1083 1 76 76 1062 1134 1 0 129 2325 -1 -1 0 0 3 0 0 3 1 0 1 1083 0 0 0
Expand Down
159 changes: 83 additions & 76 deletions cloudindex.idx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
\indexentry{:}{30}
\indexentry{rep()}{30}
\indexentry{numeric()}{31}
\indexentry{length()}{31}
\indexentry{numeric()}{31}
\indexentry{rm()}{32}
\indexentry{ls()}{32}
Expand All @@ -52,7 +51,7 @@
\indexentry{NA}{33}
\indexentry{NA}{33}
\indexentry{NA}{33}
\indexentry{is.na()}{34}
\indexentry{is.na()}{33}
\indexentry{integer}{34}
\indexentry{\%/\%}{34}
\indexentry{\%\%}{34}
Expand All @@ -77,97 +76,105 @@
\indexentry{print()}{37}
\indexentry{cat()}{37}
\indexentry{nchar()}{37}
\indexentry{trimstr()}{38}
\indexentry{paste()}{38}
\indexentry{trimws()}{39}
\indexentry{trimws()}{39}
\indexentry{character}{39}
\indexentry{substring()}{39}
\indexentry{substr()}{39}
\indexentry{sub()}{40}
\indexentry{gsub()}{40}
\indexentry{sub()}{40}
\indexentry{gsub()}{40}
\indexentry{sub()}{40}
\indexentry{gsub()}{40}
\indexentry{grep()}{40}
\indexentry{grepl()}{40}
\indexentry{grep()}{40}
\indexentry{toupper()}{38}
\indexentry{tolower()}{38}
\indexentry{strtrim()}{38}
\indexentry{strwrap()}{38}
\indexentry{cat()}{38}
\indexentry{paste()}{39}
\indexentry{paste()}{39}
\indexentry{strrep()}{39}
\indexentry{rep()}{39}
\indexentry{trimws()}{40}
\indexentry{trimws()}{40}
\indexentry{character}{40}
\indexentry{substring()}{40}
\indexentry{substr()}{40}
\indexentry{sub()}{41}
\indexentry{gsub()}{41}
\indexentry{strsplit()}{43}
\indexentry{logical}{43}
\indexentry{logical}{44}
\indexentry{\&}{44}
\indexentry{\textbar }{44}
\indexentry{\&\&}{44}
\indexentry{\textbar \textbar }{44}
\indexentry{!}{44}
\indexentry{any()}{45}
\indexentry{all()}{45}
\indexentry{all()}{45}
\indexentry{any()}{45}
\indexentry{>}{46}
\indexentry{<}{46}
\indexentry{>=}{46}
\indexentry{<=}{46}
\indexentry{==}{46}
\indexentry{!=}{46}
\indexentry{\&}{48}
\indexentry{\textbar }{48}
\indexentry{logical}{48}
\indexentry{integer}{49}
\indexentry{double}{49}
\indexentry{integer}{49}
\indexentry{integer}{49}
\indexentry{double}{49}
\indexentry{sub()}{41}
\indexentry{gsub()}{41}
\indexentry{sub()}{41}
\indexentry{gsub()}{41}
\indexentry{grep()}{41}
\indexentry{grepl()}{42}
\indexentry{grep()}{42}
\indexentry{gsub()}{42}
\indexentry{grep()}{42}
\indexentry{grepl()}{42}
\indexentry{strsplit()}{44}
\indexentry{logical}{45}
\indexentry{logical}{45}
\indexentry{\&}{45}
\indexentry{\textbar }{45}
\indexentry{\&\&}{45}
\indexentry{\textbar \textbar }{45}
\indexentry{!}{45}
\indexentry{any()}{46}
\indexentry{all()}{46}
\indexentry{all()}{46}
\indexentry{any()}{46}
\indexentry{>}{48}
\indexentry{<}{48}
\indexentry{>=}{48}
\indexentry{<=}{48}
\indexentry{==}{48}
\indexentry{!=}{48}
\indexentry{\&}{49}
\indexentry{\textbar }{49}
\indexentry{logical}{49}
\indexentry{integer}{50}
\indexentry{double}{50}
\indexentry{integer}{50}
\indexentry{integer}{50}
\indexentry{double}{50}
\indexentry{.Machine\$double.eps}{51}
\indexentry{.Machine\$double.neg.eps}{51}
\indexentry{.Machine\$double.max}{51}
\indexentry{.Machine\$double.min}{51}
\indexentry{double}{51}
\indexentry{-Inf}{51}
\indexentry{Inf}{51}
\indexentry{integer}{51}
\indexentry{integer}{51}
\indexentry{.Machine\$integer.max}{51}
\indexentry{double}{51}
\indexentry{integer}{51}
\indexentry{double}{51}
\indexentry{integer}{51}
\indexentry{integer}{51}
\indexentry{integer}{52}
\indexentry{integer}{52}
\indexentry{.Machine\$integer.max}{52}
\indexentry{double}{52}
\indexentry{integer}{52}
\indexentry{double}{52}
\indexentry{integer}{52}
\indexentry{integer}{52}
\indexentry{\^{}}{52}
\indexentry{double}{52}
\indexentry{*}{52}
\indexentry{abs()}{52}
\indexentry{\%in\%}{54}
\indexentry{is.element()}{54}
\indexentry{!}{55}
\indexentry{abs()}{53}
\indexentry{\%in\%}{55}
\indexentry{is.element()}{55}
\indexentry{|}{55}
\indexentry{!}{55}
\indexentry{\%in\%}{55}
\indexentry{is.element()}{55}
\indexentry{\%in\%}{55}
\indexentry{match()}{55}
\indexentry{match()}{55}
\indexentry{charmatch()}{55}
\indexentry{pmatch()}{55}
\indexentry{\%in\%}{55}
\indexentry{|}{56}
\indexentry{\%in\%}{56}
\indexentry{is.element()}{56}
\indexentry{\%in\%}{56}
\indexentry{match()}{56}
\indexentry{match()}{56}
\indexentry{charmatch()}{56}
\indexentry{pmatch()}{56}
\indexentry{\%in\%}{56}
\indexentry{unique()}{56}
\indexentry{unique()}{56}
\indexentry{duplicated()}{56}
\indexentry{unique()}{56}
\indexentry{numeric}{57}
\indexentry{character}{57}
\indexentry{numeric}{57}
\indexentry{\%in\%}{57}
\indexentry{mode()}{58}
\indexentry{typeof()}{58}
\indexentry{is.character()}{58}
\indexentry{is.numeric()}{58}
\indexentry{is.logical()}{58}
\indexentry{class()}{58}
\indexentry{inherits()}{58}
\indexentry{class()}{59}
\indexentry{inherits()}{59}
\indexentry{as.character()}{59}
\indexentry{as.numeric()}{59}
\indexentry{as.logical()}{59}
Expand All @@ -190,15 +197,15 @@
\indexentry{format()}{61}
\indexentry{sprintf()}{61}
\indexentry{sprintf()}{61}
\indexentry{NA}{62}
\indexentry{NA}{62}
\indexentry{NA\_real\_}{62}
\indexentry{NA\_character\_}{62}
\indexentry{NA}{62}
\indexentry{NA}{62}
\indexentry{logical}{62}
\indexentry{NA}{62}
\indexentry{NA}{62}
\indexentry{NA}{61}
\indexentry{NA}{61}
\indexentry{NA\_real\_}{61}
\indexentry{NA\_character\_}{61}
\indexentry{NA}{61}
\indexentry{NA}{61}
\indexentry{logical}{61}
\indexentry{NA}{61}
\indexentry{NA}{61}
\indexentry{letters}{63}
\indexentry{LETTERS}{63}
\indexentry{month.name}{63}
Expand All @@ -208,7 +215,7 @@
\indexentry{numeric}{67}
\indexentry{double}{67}
\indexentry{sort()}{68}
\indexentry{order()}{69}
\indexentry{order()}{68}
\indexentry{sort()}{69}
\indexentry{rle()}{69}
\indexentry{matrix}{69}
Expand Down
4 changes: 2 additions & 2 deletions faqindex.idx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
\indexentry{How do I install the \textsf {R} program in my computer?}{21}
\indexentry{How do I install the \textsf {RStudio} IDE in my computer?}{21}
\indexentry{How can I get access to \textsf {RStudio} as a cloud service?}{21}
\indexentry{How to check if an entire vector contains no values other than \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NA\vphantom {tp}}}} (or \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NaN\vphantom {tp}}}}) values?}{46}
\indexentry{How to check if a vector contains one or more \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NA\vphantom {tp}}}} (or \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NaN\vphantom {tp}}}}) values?}{46}
\indexentry{How to check if an entire vector contains no values other than \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NA\vphantom {tp}}}} (or \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NaN\vphantom {tp}}}}) values?}{47}
\indexentry{How to check if a vector contains one or more \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NA\vphantom {tp}}}} (or \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NaN\vphantom {tp}}}}) values?}{47}
\indexentry{How to access the last value in a vector?}{63}
\indexentry{How to summarize one variable from a data frame by group?}{106}
\indexentry{How to summarize numeric variables from a data frame by group?}{106}
Expand Down
4 changes: 2 additions & 2 deletions faqindex.ind
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
\item How to access the last value in a vector?, 63
\item How to change the repository used to install packages?, 181
\item How to check if a vector contains one or more \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NA\vphantom {tp}}}} (or \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NaN\vphantom {tp}}}}) values?,
46
47
\item How to check if an entire vector contains no values other than \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NA\vphantom {tp}}}} (or \texttt {\addfontfeature {Scale = 0.89}{\setlength {\fboxsep }{0.05pt}\colorbox {codeshadecolor}{NaN\vphantom {tp}}}}) values?,
46
47
\item How to install or update a package from CRAN?, 180
\item How to order columns or rows in a data frame?, 108
\item How to sample random rows from a data frame?, 193
Expand Down
Loading

0 comments on commit 8db7729

Please sign in to comment.