Sams Teach Yourself R in 24 Hours (Paperback)
暫譯: Sams 24 小時自學 R 語言 (平裝本)

Andy Nicholls, Richard Pugh, Aimee Gott

買這商品的人也買了...

相關主題

商品描述

<About>

Features
Reflects the authors' 10+ years of applied R consulting throughout industry and academia
Builds skills one step at a time, in 24 one-hour lessons that take reader from the absolute basics to advanced techniques
Covers importing, manipulating, summarizing, modeling, and plotting data; formalizing analytical code; and building R packages using the latest best practices
Shows how to use today's most popular and up-to-date analysis packages for R
Teaches through practical instructions, realistic examples, hands-on workshops, Q-and-As, quizzes, exercises, tips, and more

<Description>

In just 24 lessons of one hour or less, Sams Teach Yourself R in 24 Hours helps you learn all the R skills you need to solve a wide spectrum of real-world data analysis problems. You’ll master the entire data analysis workflow, learning to build code that’s efficient, reproducible, and suitable for sharing with others.


This book’s straightforward, step-by-step approach teaches you how to import, manipulate, summarize, model, and plot data with R; formalize your analytical code; and build powerful R packages using current best practices.

Practical, hands-on examples show you how to apply what you learn.
Quizzes and exercises help you test your knowledge and stretch your skills.

Learn How To

Install, configure, and explore the R environment, including RStudio
Use basic R syntax, objects, and packages
Create and manage data structures, including vectors, matrices, and arrays
Understand lists and data frames
Work with dates, times, and factors
Use common R functions, and learn to write your own
Import and export data and connect to databases and spreadsheets
Use the popular tidyr, dplyr and data.table packages
Write more efficient R code with profiling, vectorization, and initialization
Plot data and extend your graphical capabilities with ggplot2 and Lattice graphics
Develop common types of models
Construct high-quality packages, both simple and complex
Write R classes: S3, S4, and Reference Classes
Use R to generate dynamic reports
Build web applications with Shiny

<Sample Content>

Table of Contents
Preface     xii
HOUR 1: The R Community     1
A Concise History of R     1
The R Community     3
R Development     7
Summary     8
Q&A     8
Workshop     9
Activities     9
HOUR 2: The R Environment     11
Integrated Development Environments     11
R Syntax     14
R Objects     16
Using R Packages     23
Internal Help     28
Summary     29
Q&A     30
Workshop     30
Activities     32
HOUR 3: Single-Mode Data Structures     33
The R Data Types     33
Vectors, Matrices, and Arrays     34
Vectors     35
Matrices     49
Arrays     58
Relationship Between Single-Mode Data Objects     60
Summary     62
Q&A     62
Workshop     63
Activities     64
HOUR 4: Multi-Mode Data Structures     67
Multi-Mode Structures     67
Lists     68
Data Frames     86
Exploring Your Data     93
Summary     98
Q&A     98
Workshop     100
Activities     101
HOUR 5: Dates, Times, and Factors     103
Working with Dates and Times     103
The lubridate Package     107
Working with Categorical Data     108
Summary     112
Q&A     112
Workshop     113
Activities     114
HOUR 6: Common R Utility Functions     115
Using R Functions     115
Functions for Numeric Data     117
Logical Data     121
Missing Data     122
Character Data     123
Summary     125
Q&A     126
Workshop     126
Activities     127
HOUR 7: Writing Functions: Part I     129
The Motivation for Functions     129
Creating a Simple Function     130
The If/Else Structure     136
Summary     146
Q&A     147
Workshop     148
Activities     149
HOUR 8: Writing Functions: Part II     151
Errors and Warnings     151
Checking Inputs     155
The Ellipsis     157
Checking Multivalue Inputs     162
Using Input Definition     164
Summary     168
Q&A     168
Workshop     170
Activities     171
HOUR 9: Loops and Summaries     173
Repetitive Tasks     173
The “apply” Family of Functions     181
The apply Function     183
The lapply Function     195
The sapply Function     204
The tapply Function     208
Summary     213
Q&A     213
Workshop     214
Activities     216
HOUR 10: Importing and Exporting     217
Working with Text Files     217
Relational Databases     223
Working with Microsoft Excel     226
Summary     231
Q&A     232
Workshop     232
Activities     233
HOUR 11: Data Manipulation and Transformation     235
Sorting     236
Appending     237
Merging     238
Duplicate Values     241
Restructuring     242
Data Aggregation     249
Summary     258
Q&A     258
Workshop     259
Activities     259
HOUR 12: Efficient Data Handling in R     261
dplyr: A New Way of Handling Data     261
Efficient Data Handling with data     table     273
Summary     282
Q&A     283
Workshop     283
Activities     284
HOUR 13: Graphics     287
Graphics Devices and Colors     287
High-Level Graphics Functions     289
Low-Level Graphics Functions     298
Graphical Parameters     304
Controlling the Layout     305
Summary     308
Q&A     309
Workshop     309
Activities     311
HOUR 14: The ggplot2 Package for Graphics     313
The Philosophy of ggplot2     313
Quick Plots and Basic Control     314
Changing Plot Types     317
Aesthetics     320
Paneling (a     k     a Faceting)     328
Custom Plots     333
Themes and Layout     338
The ggvis Evolution     342
Summary     342
Q&A     343
Workshop     343
Activities     344
HOUR 15: Lattice Graphics     345
The History of Trellis Graphics     345
The Lattice Package     346
Creating a Simple Lattice Graph     346
Graph Options     356
Multiple Variables     358
Groups of Data     360
Using Panels     362
Controlling Styles     372
Summary     376
Q&A     377
Workshop     378
Activities     378
HOUR 16: Introduction to R Models and Object Orientation     379
Statistical Models in R     379
Simple Linear Models     380
Assessing a Model in R     382
Multiple Linear Regression     391
Interaction Terms     396
Factor Independent Variables     398
Variable Transformations     402
R and Object Orientation     405
Summary     407
Q&A     408
Workshop     408
Activities     409
HOUR 17: Common R Models     411
Generalized Linear Models     411
Nonlinear Models     423
Survival Analysis     430
Time Series Analysis     441
Summary     452
Q&A     452
Workshop     452
Activities     453
HOUR 18: Code Efficiency     455
Determining Efficiency     455
Initialization     458
Vectorization     459
Using Alternative Functions     462
Managing Memory Usage     463
Integrating with C++     464
Summary     468
Q&A     469
Workshop     469
Activities     470
HOUR 19: Package Building     471
Why Build an R Package?     471
The Structure of an R Package     472
Code Quality     476
Automated Documentation with roxygen2     477
Building a Package with devtools     482
Summary     485
Q&A     485
Workshop     486
Activities     487
HOUR 20: Advanced Package Building     489
Extending R Packages     489
Developing a Test Framework     490
Including Data in Packages     494
Including a User Guide     496
Code Using Rcpp     501
Summary     502
Q&A     502
Workshop     503
Activities     504
HOUR 21: Writing R Classes     505
What Is a Class?     505
Creating a New S3 Class     509
Generic Functions and Methods     511
Inheritance in S3     516
Documenting S3     518
Limitations of S3     518
Summary     519
Q&A     519
Workshop     520
Activities     520
HOUR 22: Formal Class Systems     523
S4     523
Reference Classes     535
R6 Classes     542
Other Class Systems     544
Summary     544
Q&A     545
Workshop     545
Activities     546
HOUR 23: Dynamic Reporting     547
What Is Dynamic Reporting?     547
An Introduction to knitr     548
Simple Reports with RMarkdown     548
Reporting with LaTeX     553
Summary     557
Q&A     558
Workshop     558
Activities     559
HOUR 24: Building Web Applications with Shiny     561
A Simple Shiny Application     561
Reactive Functions     566
Interactive Documents     569
Sharing Shiny Applications     570
Summary     571
Q&A     571
Workshop     571
Activities     572
APPENDIX: Installation     573
Installing R     573
Installing Rtools for Windows     575
Installing the RStudio IDE     577
Index     579

商品描述(中文翻譯)

<關於>


特點
反映作者在產業和學術界超過10年的應用R顧問經驗
透過24個一小時的課程,逐步建立技能,從基本概念到進階技術
涵蓋數據的導入、操作、總結、建模和繪圖;正式化分析代碼;以及使用最新最佳實踐構建R包
展示如何使用當今最受歡迎和最新的R分析包
通過實用的指導、真實的例子、實作工作坊、問答、測驗、練習、技巧等進行教學


<描述>


在僅僅24個一小時或更短的課程中,《Sams Teach Yourself R in 24 Hours》幫助您學習解決各種現實世界數據分析問題所需的所有R技能。您將掌握整個數據分析工作流程,學會編寫高效、可重現且適合與他人共享的代碼。



本書的簡單明瞭、逐步的教學方法教您如何使用R導入、操作、總結、建模和繪圖數據;正式化您的分析代碼;以及使用當前最佳實踐構建強大的R包。


實用的實作範例展示了如何應用您所學的知識。
測驗和練習幫助您檢測知識並提升技能。


學習如何


安裝、配置和探索R環境,包括RStudio
使用基本的R語法、對象和包
創建和管理數據結構,包括向量、矩陣和數組
理解列表和數據框
處理日期、時間和因子
使用常見的R函數,並學會編寫自己的函數
導入和導出數據,並連接到數據庫和電子表格
使用流行的tidyr、dplyr和data.table包
通過性能分析、向量化和初始化來編寫更高效的R代碼
繪製數據並使用ggplot2和Lattice圖形擴展您的圖形能力
開發常見類型的模型
構建高質量的包,無論是簡單還是複雜
編寫R類:S3、S4和引用類
使用R生成動態報告
使用Shiny構建Web應用程序


<範例內容>


目錄
前言     xii
第一小時:R社群     1
R的簡明歷史     1
R社群     3
R開發     7
總結     8
問答     8
工作坊     9
活動     9
第二小時:R環境     11
整合開發環境     11
R語法     14
R對象     16
使用R包     23
內部幫助     28
總結     29
問答     30
工作坊     30
活動     32
第三小時:單模式數據結構     33
R數據類型     33
向量、矩陣和數組     34
向量     35
矩陣     49
數組     58
單模式數據對象之間的關係     60
總結     62
問答     62
工作坊     63
活動     64
第四小時:多模式數據結構     67
多模式結構     67
列表     68
數據框     86
探索您的數據     93
總結     98
問答     98
工作坊     100
活動     101
第五小時:日期、時間和因子     103
處理日期和時間     103
lubridate包     107
處理類別數據     108
總結     112
問答     112
工作坊     113
活動     114
第六小時:常見的R工具函數     115
使用R函數     115
數值數據的函數     117
邏輯數據     121
缺失數據     122
字符數據     123
總結     125
問答     126
工作坊     126
活動     127
第七小時:編寫函數:第一部分     129
編寫函數的動機     129
創建簡單函數     130
If/Else結構     136
總結     146
問答     147
工作坊     148
活動     149
第八小時:編寫函數:第二部分     151
錯誤和警告     151
檢查輸入     155
省略號     157
檢查多值輸入     162
使用輸入定義     164
總結     168
問答     168
工作坊     170
活動     171
第九小時:迴圈和總結     173
重複任務     173
“apply”函數家族     181
apply函數     183
lapply函數     195
sapply函數     204
tapply函數     208
總結     213
問答     213
工作坊     214
活動     216
第十小時:導入和導出     217
處理文本文件     217
關聯數據庫     223
處理Microsoft Excel     226
總結     231
問答     232
工作坊     232
活動     233
第十一小時:數據操作和轉換     235
排序