Index

Symbols

, (comma)

data frame syntax, 122

function syntax, 69

key-value pair syntax, 191

" (double quotes), character data syntax, 61

' (single quotes), character data syntax, 61

.. (double dot), moving up directory, 14

. (single dot), referencing current folder, 14

| (pipe)

directing output, 20

pipe table, 48

! (exclamation point), Markdown image syntax, 47

# (pound/hashtag symbol)

comment syntax, 10, 58

$ (dollar notation)

accessing data frames, 122

accessing list elements, 9798

%>% (pipe operator), dplyr package, 141142

() (parentheses)

function syntax, 70

Markdown hyperlink syntax, 46

* (asterisk wildcard)

loading entire table from database, 173

using wildcards with files, 1718

? (question mark), query parameter syntax, 184

[] (single-bracket notation)

accessing data frames, 122123

comparing single- and double-bracket notation, 101

Markdown hyperlink syntax, 46

retrieving value from vector, 88

[[]] (double-bracket notation)

list syntax, 9899, 101

selecting data of interest for application, 312

{} (braces)

code chunk syntax, 279

key-value pair syntax, 191

render function syntax, 308

<- (assignment operator), 59, 92

>> directing output, 20

> directing output, 20

~ (tilde), home directory shorthand, 10, 15

A

Absolute path

for CSV data, 125

finding R and RScript, 57

for images, 48

specifying paths, 1415

URLs and, 47

Access tokens (API keys)

example finding Cuban food in Seattle, 196197

registering with web services, 186188

add (git). See also Staging Area

add and commit changes, 3839, 322, 327328, 333, 337

adding files to repository, 3233

unadd, 35

aes() function, for aesthetic mappings, 237

Aesthetics

adding titles and labels to charts, 246

aesthetic mappings, 234, 237238

data visualization, 229230

Aggregation

proportional representation of data and, 212213

in Shiny example, 315316

statistical transformation of data, 255

using summarize(), 138139

Analysis. See Data analysis

Annotation

capabilities of version control systems, 28

ggplot2 package, 246248

Anonymous variables, 71, 140

anscombe data set, in R, 208

Anscombe’s Quartet, 208

API keys (Access tokens)

example finding Cuban food in Seattle, 196197

registering with web services, 186188

APIs (application programming interfaces). See also Web APIs

defined, 181

in plotly package, 258

Application servers, developing, 306309

Applications

Shiny app example applying to fatal police shootings, 311318

structure in Shiny framework, 295299

app.R file, 295296

Apps, publishing Shiny, 309311

Area encoding, visualizing hierarchical data, 218

Arguments

commands and, 13

creating data frames, 120

creating lists, 96

debugging functions, 78

function inputs, 6970

function parts, 76

named arguments, 7273

syntax of, 16

vectorized functions and, 87

arrange()

dplyr core functions, 131, 137138

summarizing information using dplyr functions, 313

Arrays, JSON support, 191192

AS keyword, renaming columns, 173

Assignment operator (<-)

assigning values to variables, 59

modifying vectors, 92

Atom

preview rendering support, 4950

selecting text editor, 67

writing code, 3

Authentication, API authentication service, 187

B

Bar charts

facets and, 245

position adjustments, 240

proportional representation of data, 211213

visualizing data with single variable, 210211

Bash shell. See also Git Bash

commands, 13

executing code, 4

ls command, 13

Bins, breaking data into different variables, 142

BitBucket, comparing with GitHub, 29

Blockquotes, markdown options, 48

Blocks, markdown formatting syntax, 47

Body, function parts, 7677

Bokeh package, 261

Bold, text formatting, 4546

Books, resources for learning R, 65

Boolean. See Logical (boolean)

Box plots, 210

Bracket notation

double. See [[]] (double-bracket notation)

retrieving value from vector using bracket notation, 88

single. See [] (single-bracket notation)

Branches

git branching model, 319320

merging, 324325

merging from GitHub, 328329

resolving merge conflicts, 327328

tracking code versions with, 319320

using in feature branch workflows, 333335

using in forking workflows, 335339

working with, 320324

working with feature branches, 329331

C

c() function, creating vectors, 8182

Case sensitivity, variable names, 58

Categorical data. See Nominal (categorical) data

Causality, assessing statistical relationships, 341

cd, change directory command, 1213

Centralized workflow

creating centralized repository, 331333

feature branches in, 333335

overview of, 331

working with feature branches, 333335

Character data type

lists and, 95

overview of, 61

vectorized functions and, 87

Charts, 229. See also by individual types of graphs

Cheatsheets

for dplyr, 148

for ggplot2, 255

for GitHub, 43

for markdown, 48

for R functions, 71

for RStudio, 56, 280, 318

checkout (git)

switching between branches, 321324

working with feature branches, 329330

working with feature branches in centralized workflow, 335

Checkpoints. See Commit

Choropleth maps

drawing and examples, 248251

overview of, 248

Chunks

breaking data into different variables, 142

inline code and, 280

options, 279280

.Rmd files and, 277278

Circle packing, visualizing hierarchical data, 218219

clone (git)

collaboration using forking workflow, 336

creating centralized repository, 332

forks, 337

merging branches and, 328

repos, 3639, 43

understanding/using git commands, 43

Code

chunks, 142, 277280

executing, 45

inline code, 280

managing, 34

running, 5457

syntax-colored code blocks, 48

tracking versions with branches, 319320

Visual Studio Code (VS Code), 7, 49

writing, 3

Collaboration

centralized workflow for, 331

creating centralized repository, 331333

interactive web applications and. See Shiny framework

merging branches, 324325, 328329

overview of, 273274, 319

reports. See R Markdown

resolving merge conflicts, 327328

tracking code versions, 319320

working with branches, 320324

working with feature branches, 329331, 333335

working with forking workflows, 335339

collect(), manipulating table data, 177178

Colon operator (a:b)

creating vectors, 82

specifying range of vector index, 90

Color

adding to Leaflet map, 270

color palettes, 223225, 242

effective for data visualization, 222226

ggplot2 color scales, 242243

ColorBrewer tool

color palettes, 242

examples, 289

overview of, 223225

colorFactor(), Leaflet maps, 270

Columns

changing to/from rows using tidyr, 157159

dplyr arrange() operation, 137138

dplyr filter() operation, 135

dplyr mutate() operation, 136

Columns (fields), in relational databases, 168

Comma-separated value data. See CSV (comma-separated value) data

Command line

accessing, 910

changing directories, 1213

cloning repository, 37

commit history, 320

directing/redirecting output, 20

executing code, 4

handling errors, 1819

interacting with databases, 31

learning new commands, 1617

listing files, 13

managing files, 1516

navigating files, 1112

networking commands, 2023

overview of, 9

running R code, 5657

set up tools, 45

specifying paths, 1415

wildcards, 1718

working with, 4

Command prompt. See Command line

Command Prompt (Windows)

accessing, 910

executing code, 4

working with, 5

Command shell (terminal). See Command line

Commands. See also by individual types

issuing, 13

list of advanced, 18

list of basic, 15

Comments

R language, 58

syntax for code comments, 10

commit (git)

add and commit changes, 33, 3839, 327328, 337

creating centralized repository, 333

git core concepts, 28

history, 40

message etiquette, 3435

reverting to earlier versions, 4042

tracking code versions, 319320

understanding/using git commands, 43

working with branches, 320324

working with feature branches, 330331, 334

Communities

resources for learning R, 6667

sources of data, 109

Comparison operators, logical values and, 62

Compiled languages, 53

Complex data type, 63, 99

Comprehensive R Archive (CRAN), 6

Computer, set up, 34

Concurrency, capabilities of version control systems, 28

Conditional statements, 7980

config, configuring git for first-time use, 30

Console, RStudio, 55

Content

building Shiny application, 313

content elements in designing UIs, 299

extracting from HTTP request, 200

static content in Shiny framework, 300301

content(), extracting content from HTTP request, 200

Continuous color scales, 225226

Continuous data

choosing effective colors for data visualization, 223

selecting visual layouts, 209210

visualization with multiple variables, 213216

visualizing with single variable, 210

Control widgets

developing application servers, 307

in Shiny framework, 295

user interactions in Shiny apps, 301303

coord_ functions

coord_flip() example, 244

types of coordinate systems for geometric objects, 243244

Coordinate systems

coord_flip() example, 244

creating choropleth maps, 249250

creating dot distribution maps, 252

Grammar of Graphics, 232

types for geometric objects, 243244

cor(), correlation function in R, 161

count(), summarizing information, 313

Courses, resources for learning R, 6566

CRAN (Comprehensive R Archive), 6

CSS language, 342

CSV (comma-separated value) data

factor variables, 126129

loading data sets from .csv file, 167

read.csv(), 161

viewing working directory, 125126

working with, 124125

ctrl+c, stopping or canceling program or command, 19

D

d3.js JavaScript library, 343

Data

acquiring domain knowledge, 112113

analyzing. See Data analysis

answering questions, 116118

dplyr example analyzing flight data, 148153

dplyr grammar for manipulating, 131132

encoding, 220222, 229, 237

finding, 108109

flattening JSON data, 196197

generating, 107108

interactive presentation, 293

interpreting, 112

measuring, 110111

overview of, 107

ratio data, 111

reusable functions in managing, 70

schemas, 113116

structures, 111112, 122

transforming into information, 341

understanding data schemas, 113116

visualization of. See Data visualization

working with CSV data, 124125

wrangling, 106

Data analysis

generating data, 108

reusable functions, 70

tidyr package. See tidyr package

Data frames

accessing, 122123

analyzing by group, 142144

creating, 120121

describing structure of, 121122

factor variables, 126129

joining, 144148

overview of, 119120

viewing working directory, 125126

working with CSV data, 124125

data() function, viewing available data sets, 124125

Data-ink ratio, aesthetics of graphics, 229

Data schemas, 113116

Data structures

overview of, 111112

two-dimensional, 122

Data types

factors, 120

lists and, 95

R language, 6063

selecting visual layouts, 209210

vectorized functions and, 87

vectorized operations and, 83

Data visualization

aesthetics, 229230

choosing effective colors, 222226

choosing effective graphical encodings, 220222

expressive displays, 227229

ggplot2. See ggplot2 package

of hierarchical data, 217220

leveraging preattentive attributes, 226227

with multiple variables, 213217

overview of, 205207

purpose of, 207209

reusable functions, 70

selecting visual layouts, 209210

with single variable, 210213

tidyr package. See tidyr package

Data visualization, interactive

example exploring changes to Seattle, 266272

leaflet package, 263266

overview of, 257258

plotly package, 258261

rbokeh package, 261263

Databases

accessing from R, 175179

designing relational, 144

overview of relational, 167169

setting up relational, 169171

SQL statements, 171175

DataCamp, resources for learning R, 66

dbConnect(), accessing SQLite, 176177

dbListTables(), listing database tables, 177

dbplyr package, 176179

dbplyr package, accessing databases, 174

Debugging functions, 78. See also Error handling

Directories

accessing command line and, 10

changing from command line, 1213

printing working directory, 11

tree structure of, 12

turning into a repository, 31

viewing working directory, 125126

Displays, expressive, 227229

Distributions, of x and y values (statistics), 208209

Documentation

of commands, 16

getting help via, 64

resources for learning R, 66

Shiny layouts, 304

Documents

creating, 275

knitting, 278

Domain, interpreting data by, 112113

Dot distribution maps, 248, 251252

Double-bracket notation. See [[]] (double-bracket notation)

dplyr package

analyzing data frames, 142144

analyzing flight data, 148153

arrange(), 137138

converting dplyr functions into SQL statements, 178

core functions, 131132

example mapping evictions in San Francisco, 252

example report on life expectancy, 289

filter(), 135136

grammar for data manipulation, 131132

group_by(), 244

joining data frames, 144148

mutate(), 136137

orienting data frames for plotting, 239

overview of, 131

performing sequential operations, 139141

pipe operator (%>%), 141142

select(), 133134

summarize(), 138139

Dynamic inputs, Shiny framework, 301303

Dynamic outputs, Shiny framework, 303304

Dynamically typed languages, 60

E

Encoding data

aesthetic graphics, 229

aesthetic mappings, 237

choosing effective graphical encodings, 220222

Endpoints, web APIs, 183185

Environment pane, RStudio, 55

Error handling

command line, 1819

debugging functions, 78

reading error messages, 63

Ethical responsibilities, 343

Excel, working with CSV data, 124

exit

disconnecting from remote computer, 22

stopping or canceling program or running command, 19

Expressions, multiple operators in, 61

Extensions, file, 6, 4849

F

facet_ functions, 244245

Facets

ggplot2 package, 244245

Grammar of Graphics, 232

Factors

creating data frames, 120

variables, 126129

Feature branches

in centralized workflow, 333335

working with, 329331

Fields (columns), in relational databases, 168

figure(), creating Bokeh plots, 262263

Files

adding to repository, 3233

changing directories, 1213

creating .Rmd files, 276278

extensions, 6, 4849

ignoring, 4244

listing, 13

managing, 1516

navigating, 1112

specifying paths, 1415

fill(), aesthetic layouts, 238240

filter()

dplyr core functions, 131, 135136

example report on life expectancy, 289

manipulating table data, 177178

Filtering

joins, 148

vectors, 9091, 93

flatten()

example finding Cuban food in Seattle, 200, 202

JSON data, 196197

for loops, 87

Foreign keys, in relational databases, 168169

fork, repos on GitHub, 3638

Forking workflow

feature branches in, 331, 333335

working with, 335339

Formats

table, 157

text, 46

Formulas, 245

Frameworks

defined, 293

Shiny framework. See Shiny framework

fromJSON(), converting JSON string to list, 193194, 200

full_join(), 148

function keyword, 76

Functions

for aesthetic mappings (aes()), 237238

applying to lists, 102103

built-in, 7172

c() function, 8182

conditional statements, 7980

converting dplyr functions into SQL statements, 178

coord_ functions, 243244

correlation function (cor()), 161

creating lists, 96

debugging, 78. See also Error handling

developing application servers, 307309

geometry. See geom_ functions

inspecting data frames, 121122

loading, 7375

named arguments, 7273

nested statements within, 140141

overview of, 6970

referencing database table, 177

in Shiny layouts, 305

syntax, 7071

tidyr functions for changing columns to/from rows, 157159

vectorized, 8688

viewing available data sets (data()), 124125

writing, 7577

Functions, dplyr

arrange(), 137138

core functions, 131132

filter(), 135136

group_by(), 142144

left_join(), 145147

mutate(), 136137

overview of, 132

select(), 133134

summarize(), 138139

summarizing information using, 313

G

gather()

applying to educational statistics, 161163

combining with spread(), 159

tidyr function for changing columns to rows, 157158

geom_ functions

adding titles and labels to charts, 247248

aesthetic mappings and, 237238

creating choropleth maps, 249250

creating dot distribution maps, 252

example mapping evictions in San Francisco, 253256

rendering plots, 284

specifying geometric objects, 234

specifying geometries, 235237

statistical transformation of data, 237

Geometries

ggplot2 layers, 232

position adjustments, 238240

specifying geometric objects, 234235

specifying with ggplot2 package, 235237

GET

example finding Cuban food in Seattle, 197198, 202

HTTP verbs, 188189

sending GET requests, 189190

getwd(), viewing working directory, 125

ggmap package

example finding Cuban food in Seattle, 200203

example mapping evictions in San Francisco, 253

map tiles, 252

ggplot()

creating plots, 232, 234

example mapping evictions in San Francisco, 256

ggplot2 package

aesthetic mappings, 237238

basic plotting, 232235

choropleth maps, 248251

coordinate systems, 243244

dot distribution maps, 252

example finding Cuban food in Seattle, 200

example mapping evictions in San Francisco, 252256

facets, 244245 Grammar of Graphics, 231232

labels and annotations, 246248

map types, 248

position adjustments, 238240

rendering plots, 284

specifying geometries, 235237

static plot of iris data set, 257258

statistical transformation of data, 255

styling with scales, 240242 tidyr example, 160161

ggplotly(), 259

ggrepel package, preventing labels from overlapping, 247248

git

accessing project history, 4042

adding files, 3233

branching model. See Branches

checking repository status, 3133

committing changes, 3335

core concepts, 2728

creating repository, 3031

ignoring files, 4244

installing, 5

leveraging using GitHub, 6

local git process, 35

managing code with, 34

overview of, 2728

project setup and configuration, 30

tracking changes, 32

tutorials, 4344

version control, 4

Git Bash. See also Bash shell

accessing command line, 910

commands used by, 13

executing code using Bash shell, 45

ls command, 13

tab-completion support, 15

Git Flow model, 335

GitHub

accessing project history, 4042

creating centralized repository, 331333

creating GitHub account, 6

forking/cloning repos on GitHub, 3638

ignoring files, 4244

managing code with, 3

overview of, 29

pushing/pulling repos on GitHub, 3840

README file, 4849

sharing reports as website, 285286

storing projects on, 36

tutorials, 4344

.gitignore, ignoring files, 4244

GitLab, comparing with GitHub, 29

Google Docs, version control systems compared with, 28

Google, getting help via, 63

Google Sheets, working with CSV data, 124

Government publications, sources of data, 108

Grammar of Data Manipulation (Wickham), 131

Grammar of Graphics, 231232

Graphics. See also by individual types of graphs; Data visualization

aesthetics, 229230

choosing effective graphical encodings, 220222

expressive displays, 227229

with ggplot2. See ggplot2 package Grammar of Graphics, 231232

leveraging preattentive attributes, 226227

selecting visual layouts, 209210

visualizing hierarchical data, 217220

group_by()

analyzing data frames by group, 142144

facets and, 244

statistical transformation of data, 255

summarizing information using, 313

GROUP_BY clause, SQL SELECT, 174

H

Heatmaps. See also Choropleth maps

data visualization with multiple variables, 215, 217

example mapping evictions in San Francisco, 256

Help

R language, 6364

RStudio, 55

Hidden files, 4244

Hierarchical data, visualization of, 217220

Histograms

data visualization with multiple variables, 216

expressive displays, 229

visualizing data with single variable, 210

Hosts, Shiny apps, 309310

HSL Calculator, 223

HSL (hue-saturation-lightness) color model, 222223

HTML (Hypertext Markup Language)

HTML Tags Glossary, 300301

markup languages, 45

sharing reports as website, 284286

web development language, 342

HTTP (HyperText Transfer Protocol)

header, 196197

overview of, 181182

verbs, 188189

HTTP requests

example finding Cuban food in Seattle, 196200

response header and body, 190

web services and, 181

HTTP verbs, Web APIs, 188189

httr package

parsing JSON data, 192193

sending GET requests, 189190

Hue

choosing effective colors for data visualization, 222

multi-hue color scales, 225

Hue-saturation-lightness (HSL) color model, 222223

Hyperlinks, markdown, 4647

I

Icons, types of interfaces, 9

IDE (integrated development environment), 54

if_else, conditional statements, 7980

Images, markdown, 4748

Indices

for getting subsets of vectors, 8889

multiple indices, 8990

init (git), turning a directory into a git repository, 31

Inline code, in R Markdown, 280

INNER JOIN clause, SQL

SELECT, 174

inner_join(), 147148

Inputs

dynamic inputs with Shiny framework, 301303

functions and, 69

Shiny framework, 293294

Integer data type, 63

Integrated development environment (IDE), 54

Interactivity

interactive data visualization. See Data visualization, interactive

interactive web applications. See Shiny framework

Interface

command line as, 9

defined, 181

user. See UIs (user interfaces)

web APIs. See Web APIs

Interpreted languages, 53

Interval data, measuring data, 111

iris data set, interactive plots in, 257258

Italics, text formatting, 4546

J

JavaScript, 342343

join()

dplyr core functions, 131

joining data frames, 144148

JOIN clause, SQL SELECT, 174175

Journalism, sources of data, 109

JSON (JavaScript Object Notation)

flattening JSON data, 195197

list of lists structure in, 97

parsing JSON data, 193195

processing JSON data, 191193

jsonlite package, 192193

K

kable(), knitr package, 283284, 291

Key-value pairs

JSON (JavaScript Object Notation), 191

query parameters and, 184

tidyr data tables, 157

knitr package

creating R Markdown documents, 275

kable(), 283284, 291

Knitting documents, 278

L

Labels

adding to plots, 246248

aesthetics of graphics, 230

labs(), adding titles and labels to charts, 246

lapply(), applying functions to lists, 102103

Layers, ggplot2 package, 232

layout(), 260261, 268

Layouts

coordinate systems, 243244

designing UIs, 299

example exploring changes to Seattle, 268

facets, 244245

labels and annotations, 246248 plotly package, 260261

position adjustments, 238240

selecting visual, 209210

Shiny framework, 304306

styling with scales, 240242

Lazy evaluation, in dplyr package, 178

leaflet()

creating Leaflet map, 264

example exploring changes to Seattle, 269

leaflet package

creating interactive plots, 264266

example exploring changes to Seattle, 269271

installing and loading, 263

Shiny app example applying to fatal police shootings, 312313

Learn Git Branching, 339

LEFT JOIN clause, SQL

SELECT, 174

left_join()

example of join operation, 145146

join types, 146147

Legends

adding to Leaflet map, 270271

aesthetics of graphics, 230

length() function, determining number of elements in a vector, 82

Libraries. See Packages

library(), referencing external packages, 311

Lightness, choosing effective colors for data visualization, 223

Linux

command-line tools on, 5

installing git, 5

list() function, creating lists, 96

Lists

accessing elements of, 9799

applying functions to, 102103

converting JSON string to list, 193194

creating, 9697

creating data frames, 120121

double-bracket notation, 101

JSON structures compared with, 192193

listing files from command line, 13

modifying, 100

overview of, 95

rendering Markdown lists, 282283

log, viewing commit history, 40

Logical (boolean)

data type, 6163

debugging functions, 78

operators, 6263

vector filtering by values, 9091

Loops, vectorized functions and, 87

ls

list folder contents, 13

using with remote computer, 22

M

-m option, adding messages to commit command, 34

Mac OSs. See also Terminal (Mac)

accessing command line, 910

command-line tools on, 4

installing git, 5

Machine learning, making predictions, 342

Mackinlay’s Expressiveness Criteria, 227229

man, looking up commands in manual, 1617

Map tiles

adding to Leaflet map, 264

ggmap package, 252

Maps

aesthetic mappings, 237238

choropleth maps, 248251

dot distribution maps, 251252

example mapping evictions in San Francisco, 252256

interactive, 263

types of, 248

Markdown

hyperlinks, 4647

images, 4748

overview of, 45

rendering, 4850

rendering lists, 282283

rendering strings, 281

rendering tables, 283284

static content elements of UIs, 300301

tables, 48

text formatting and blocks, 46

Markdown Reader, 49

Markers, adding to Leaflet map, 264

Markup languages, 45

Mathematical operators

applying to vectors, 83

assigning values to variables, 59

using on numeric data types, 60

vectorized functions and, 8687

Matrix, two-dimensional data structures in

R, 122

.md file extension, for markdown files, 48

Menus, types of interfaces, 9

merge (git)

combining branches, 324325

forking/cloning repository on GitHub, 337338

resolving merge conflicts, 327328

working with feature branches, 330, 334335

Merging, git core concepts, 29

message etiquette,

commit, 3435

Meta-data, 114116, 277

Microsoft Excel, 124

Microsoft Windows. See Windows OSs

mkdir, documentation of commands, 1617

Moral responsibility, 343

mutate()

dplyr core functions, 131, 136137

example finding Cuban food in Seattle, 202

example report on life expectancy, 289290

Mutating joins, 148

MySQL, 171

N

NA value

compared with NULL, 100

logical values and, 89

modifying vectors and, 92

Named arguments,

R functions, 7273

Named lists, creating data frames, 120

names() function, creating lists and, 96

Negative index, vector indices, 89

Nested objects, JSON support, 192

Nested statements, within other functions, 140141

Nested structures, visualizing hierarchical data, 217220

Networking commands, 2023

News, sources of data, 109

Nominal (categorical) data

choosing effective colors for data visualization, 223

data visualization with multiple variables, 215

measuring data, 110

proportional representation of data and, 212

selecting visual layouts and, 209210

visualizing single variable, 210

Non-standard evaluation (NSE), dplyr, 133

NULL value, modifying lists and, 100

Numbers, working with CSV data, 124

Numeric data type, 6061, 95

O

OAuth, API authentication service, 187

Observations, data structures, 111112

ON clause, SQL

SELECT, 174

Online communities, sources of data, 109

Open source,

R language as, 53

OpenStreetMap, 264

Operationalization, using data to answer questions, 116118

Optional arguments, functions and, 72

Options (flags), argument syntax, 16

OPTIONS, HTTP verbs, 188

ORDER_BY clause, SQL SELECT, 174

Ordinal data

measuring data, 110111

selecting visual layouts and, 209210

Orientation, tidyr data tables, 157

Out-of-bounds indices, vector indices, 89

OUTER JOIN clause, SQL

SELECT, 174

Outliers, visualizing data with single variable, 210

Output

directing/redirecting, 20

dynamic, 303304

functions and, 69

reactive, 295

Shiny framework, 293294

P

Packages

Bokeh, 261

dbplyr, 176179

dplyr. See dplyr package

ggmap. See ggmap package

ggplot2. See ggplot2 package

ggrepel, 247248

httr, 189190, 192193

jsonlite, 192193

knitr. See knitr package

leaflet. See leaflet package

plotly, 258261

of R functions, 7375

rbokeh, 261263

RColorBrewer, 224225

referencing external, 311

rmarkdown, 275

RStudio, 55

tidyr. See tidyr package

tidyverse, 132, 142

Panning, interactive data visualization, 257

Parameters

function inputs, 6970

query parameters, 184186, 202

Passing arguments

debugging functions, 78

to functions, 70

PATCH, HTTP verbs, 188

Paths

finding, 57

on remote computers, 22

specifying from command line, 1415

viewing working directory, 125

Pie charts, 211213, 221

pipe operator (%>%), dplyr package, 141142

pipe table, 48

plot_ly()

creating plots, 260

example exploring changes to Seattle, 268

plotly package

creating interactive plots, 259261

example exploring changes to Seattle, 268

loading, 258

Plots

ggplot2 package. See ggplot2 package

plotly package. See plotly package

plotting, 232235

rendering in R Markdown, 284

RStudio, 55

Pointers, types of interfaces, 9

Popups, adding interactivity to Leaflet map, 266

Positional arguments

functions and, 7273

ggplot2 geometries, 238240

PostgreSQL, 170171, 176

Powershell, Windows Management Framework, 5

Preattentive processing, in data visualization, 226227

Predictions, 342

Preview Markdown rendering, 49

Primary keys, in relational databases, 168169

print(), analyzing flight data, 152

Probability, 342. See also Statistics Problem domain, interpreting data by domain, 112113

Programming/programming languages

compiled languages, 53

data wrangling, 106

dynamically vs. statically typed languages, 60

interpreted languages, 53

learning, 342343

markup languages, 45

R language. See R language

S language, 53

SQL. See SQL (Structured Query Language)

statically typed, 60

statistical languages, 53

Proportional representation, visualizing data with single variable, 211212

publishing apps, Shiny framework, 309311

pull (git)

creating centralized repository, 333

merging from GitHub, 328

repos on GitHub, 3840

understanding/using git commands, 43

working with feature branches, 335

Pull request, GitHub, 335339

push (git)

creating centralized repository, 333

merging from GitHub, 328329

repos on GitHub, 3840

understanding/using git commands, 43

working with feature branches, 333335

pwd, print working directory, 11, 22

Python, 342

Q

qmplot(), creating background maps, 253254

Query parameters

example finding Cuban food in Seattle, 202

in Web URIs, 184186

quit (q), stopping or canceling program or running command, 19

R

R for Everyone, 341

R language

accessing databases, 175179

accessing Web APIs, 189190 anscombe data set in, 208

arguments, 7273

built-in functions, 7172

code chunks and, 279280

comments, 58

data types, 6063

downloading, 68

as dynamically typed language, 60

function packages, 7375

function syntax, 7071

functions in Shiny layouts, 305

help resources, 6364

interactive data visualization. See Data visualization, interactive learning, 6467

overview of, 4

programming with, 5354

running R code from command line, 5657

running R code using RStudio, 5456

two-dimensional data structures, 122

variable definition, 5860

web application framework. See Shiny framework

R Markdown

code chunks and, 279280

creating .Rmd files, 276278

example report on life expectancy, 287292

inline code and, 280

knitting documents, 278

rendering lists, 282283

rendering plots, 284

rendering strings, 281282

rendering tables, 283284

setting up reports, 275

sharing reports, 284286

static content elements of UIs, 300301

Ratio data, measuring, 111

rbokeh package

creating interactive plots, 262263

installing and loading, 261262

RColorBrewer package, 224225

RDMS (relational database management system), 169. See also Relational databases

Reactive output

dynamic outputs with Shiny framework, 303304

render functions and, 308

in Shiny framework, 295

Reactivity, in Shiny framework, 295

read.csv()

creating choropleth maps, 250

example mapping evictions in San Francisco, 253

in R, 161

README file, GitHub, 4849

Records

data structures, 111112

keeping, 107108

Recycling operation, vectors, 8485

Redirects, output, 20

Relational databases

accessing, 175179

designing, 144

overview of, 167169

setting up, 169171

SQL statements, 171175

Relational operators

logical values and, 62

vector filtering with, 91

Relationships

assessing in statistical learning, 341342

between x and y values (statistics), 208209

Relative path

images, 48

specifying paths, 14

URLs, 47

viewing working directory, 125126

Remote repository

git core concepts, 29

repositories as remotes, 36

Remote computers, accessing, 2021

Render function

developing application servers, 307309

in Shiny framework, 295296

Rendering markdown, 4850

Reports, 275. See also R Markdown

Repository (repo)

checking status, 3133

creating, 3031

creating centralized repository, 331333

forking/cloning on GitHub, 3638, 336337 git core concepts, 28

linking online to local, 36

pushing/pulling on GitHub, 3840

viewing current branch, 320321

REpresentational State Transfer. See REST (REpresentational State Transfer)

Required arguments, functions and, 72

Research, sources of data, 109

reset, destroying

commit history, 42

Response body, HTTP requests, 190

Response header, HTTP requests, 190

REST (REpresentational State Transfer)

responding to HTTP requests, 189

web APIs, 182

web services and, 181

Return value

c() function, 8182

function parts, 77

writing functions, 7576

Reversibility

capabilities of version control systems, 28

reverting to earlier versions, 4042

revert, reverting to earlier versions, 4042

RIGHT JOIN clause, SQL

SELECT, 174

right_join(), 145147

rmarkdown package, creating R Markdown documents, 275

.Rmd files, creating, 276278

round() function, vectorized functions and, 8687

Rows

arrange() operation, 137138

changing from columns to/from, 157159

filter() operation, 135

Rows (records), in relational databases, 168

RScript, running scripts from command line, 57

RStudio

changing working directory, 125

cheatsheet, 56, 280, 318

creating list elements, 97

creating .Rmd files, 276278

debugging functions, 78

downloading, 8

getting help via RStudio community, 64

ggplot2 graphics in RStudio window, 233

knitting documents, 278

running R code, 5456

running Shiny apps, 297298

writing code with, 3

rworldmap, example report on life expectancy, 289, 291

S

sapply(), applying functions to lists, 103

Saturation, choosing effective colors for data visualization, 222

Scalable vector graphics (SVGs), 266

Scalar, example adding, 8586

Scale, ggplot2

color scales, 242243

styling with, 240241

Scatterplot matrix, 213

Scatterplots

Anscombe’s Quartet, 209

data visualization with multiple variables, 213217

ggplot2 example, 233

Scientific research, sources of data, 109

Scripts

programming with R language, 5354

running from command line, 57

running using RStudio, 54

select()

dplyr core functions, 131, 133134

example report on life expectancy, 289290

manipulating table data, 177178

SELECT statement

ON clause, 174

JOIN clause, 174175

ORDER_BY and GROUP_BY clauses, 174

SQL statements, 171174

WHERE clause, 173174

Sensors, generating data, 107

seq() function, creating vectors and, 8283

Sequences, performing sequential operations, 139141

Servers

application structure in Shiny framework, 296

building Shiny application, 313318

defined, 294

developing application servers, 306309

division of responsibility in Shiny apps, 298299

Shapefiles, creating choropleth maps, 248249

Shapes, adding to Leaflet map, 264

Sharing. See Collaboration

Shiny framework

application structure, 295299

core concepts, 294295

designing user interfaces, 299

developing application servers, 306309

dynamic inputs, 301303

dynamic outputs, 303304

example applying to fatal police shootings, 311318

layouts, 304306

overview of, 293294

publishing Shiny apps, 309311

static content, 300301

shinyApp(), 296297, 299

shinyapp.io, hosting Shiny apps, 309310

Sidebar, in Shiny example, 316

Single-bracket notation. See [] (single-bracket notation)

Slideshows, 275

snake_case

variable names, 58

writing functions, 76

Snapshots. See Commit

source(), loading and running API keys, 188

spread()

applying to educational statistics, 164165

changing rows to columns, 158159

Spreadsheets, working with CSV data, 124

SQL (Structured Query Language)

converting dplyr functions into SQL equivalents, 178

JOIN clause, 174175

ORDER_BY and GROUP_BY clauses, 174

resources for learning, 171

SELECT statement, 171173

WHERE clause, 173174

SQLite

accessing from R, 176177

SELECT statement in, 172

types of RDMSs, 169170

WHERE clause, 173174

ssh, accessing remote computers, 2122

Stacked bar charts, 211213, 239

StackOverflow, getting help via, 64

Staging area, adding files, 33. See also add (git)

Statements

conditional, 7980

SQL, 171175

Static content

building Shiny application, 313

Shiny framework, 300301

Statically typed language, 60

Statistical learning

assessing relationships, 341342

making predictions, 342

overview of, 341

Statistics

Anscombe’s Quartet, 208209

applying tidyr to educational statistics, 160165

statistical transformation of data, 237, 255

status (git)

checking project status, 323

checking repository status, 3133

pushing branches to GitHub, 329

resolving merge conflicts, 327328

understanding/using git commands, 43

Strings

character data types, 61

rendering in R Markdown, 281282

Style, vs. syntax, 59

Sublime Text, selecting text editor, 7

Subplots, facets and, 244

Subset, of vector, 8889

summarize(), dplyr core functions, 131, 138139

Sunburst diagrams, 218, 220

Surveys, generating data, 107

SVGs (scalable vector graphics), 266

Syntax

debugging functions, 78

vs. style, 59

Syntax-colored code blocks, markdown options, 48

T

Tab-completion, command shells supporting, 15

Tables

building Shiny application, 314318

creating data frames, 120

data structures, 111112 JOIN clause, 174

markdown, 48

referencing database table, 177

in relational databases, 168

rendering, 283284

tidyr, 157

Tagged elements, in lists, 9596

tbl(), referencing database table, 177

Terminal (command shell). See Command line

Terminal (Linux), 5

Terminal (Mac)

accessing, 910

connecting to remote server, 21

executing code, 4 ls command, 13

manuals (man pages), 17

running R code, 5657

setting up, 4

tab-completion support, 15

Text blocks, markdown, 46

Text editor, 67

Text formatting, 46

theme(), creating choropleth maps, 251

Tibble data frame, 142143

tidyr package

applying to educational statistics, 160165

changing from columns to/from rows, 157159

example mapping evictions in San Francisco, 252

orienting data frames for plotting, 239

overview of, 155157

reshaping data sets, 165

The tidyverse style guide

defining variables, 58 dplyr package, 132

tibble data frame, 142143

writing functions, 76

Treemaps, 211213, 218220

Tutorials, for learning R, 6566

U

UIs (user interfaces)

application structure in Shiny framework, 295296

building Shiny application, 313318

defined, 294

designing, 299

division of responsibility in Shiny apps, 298299

Unit of analysis, grouping for redefining, 144

Unordered lists, rendering Markdown lists, 282283

URIs (Uniform Resource Identifiers)

example finding Cuban food in Seattle, 202

HTTP requests and, 182184

hyperlink syntax, 4647

URLs (Uniform Resource Locators), 182, 286

User interfaces. See UIs (user interfaces)

Users, accessing command line, 10

V

Values

creating vectors, 8182

modifying vectors, 9293

tidyr cells representing, 155

vectors as one-dimensional collections of, 81

Variables

anonymous, 71, 140

breaking data into, 142

creating intermediary variables for use in analysis, 139

data visualization with multiple, 213217

data visualization with single, 210213

defining, 5860

factor variables, 126129

storing Shiny layouts in, 305

tidyr columns representing, 155

VCS (version control system), 28

Vectorized functions, 8688

Vectors

creating, 8183

creating data frames, 120

example adding, 8586

filtering, 9091

lists and, 95

modifying, 9293

multiple indices, 8990

overview of, 81

performing operations on, 8384

recycling operation, 8485

subsets of, 8889

vectorized functions, 8688

Verbs

dplyr package, 131

HTTP verbs, 188189

Version control

accessing project history, 4042

adding files, 3233

checking repository status, 3133

command line in, 9

committing changes, 3335

creating repository, 3031

forking/cloning repos and, 3638

git for, 4, 2729

GitHub for, 29

ignoring files, 4244

local git process, 35

overview of, 27

project setup and configuration, 30

pushing/pulling repos and, 3840

storing projects on GitHub, 36

tracking changes, 32, 319320

Version control system (VCS), 28

Videos, resources for learning R, 65

Violin plots

data visualization with multiple variables, 215

data visualization with single variable, 210

Visual channels, aesthetic mappings and, 237

Visual storytelling with D3, 343

Visualization. See Data visualization

VS Code (Visual Studio Code)

preview rendering support, 49

selecting text editor, 7

W

Web APIs

access tokens (API keys), 186188, 196197

accessing from R, 189190

example locating Cuban food in Seattle, 197203

flattening JSON data, 195197

HTTP verbs, 188189

overview of, 181182

parsing JSON data, 193195

processing JSON data, 191193

query parameters, 184186

RESTful requests, 182

URIs and, 182184

Web applications

defined, 293

interactive. See Shiny framework

Web browsers, Shiny framework as interface, 293294

Web servers, 182. See also Servers

Web services. See also Web APIs

overview of, 181

registering with, 186188

Webpage, URL for, 286

Websites

creating using R Markdown, 275

publishing Shiny apps, 309311

sharing R Markdown reports, 284286

WHERE clause,

SELECT statement, 173174

Widgets. See Control widgets

Wildcards, command line, 1718

Windows, icons, menus, and pointers (WIMP), 9

Windows Management Framework, 5

Windows OSs

accessing command line, 910

command-line tools, 45

installing git, 5

Windows, types of interfaces, 9

Workflows

centralized, 331

creating centralized repository, 331333

tracking code versions with branches, 319320

working with feature branch workflows, 333335

working with forking workflows, 335339

X

Xcode command line developer tools, 5

Z

Zooming, interactive data visualization, 257

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.13.194