Muutke küpsiste eelistusi

E-raamat: Efficient R Programming: A Practical Guide to Smarter Programming

  • Formaat: 222 pages
  • Ilmumisaeg: 08-Dec-2016
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781491950739
  • Formaat - EPUB+DRM
  • Hind: 28,67 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 222 pages
  • Ilmumisaeg: 08-Dec-2016
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781491950739

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

There are many excellent R resources for visualization, data science, and package development. Hundreds of scattered vignettes, web pages, and forums explain how to use R in particular domains. But little has been written on how to simply make R work effectively-until now. This hands-on book teaches novices and experienced R users how to write efficient R code. Drawing on years of experience teaching R courses, authors Colin Gillespie and Robin Lovelace provide practical advice on a range of topics-from optimizing the set-up of RStudio to leveraging C++-that make this book a useful addition to any R user's bookshelf. Academics, business users, and programmers from a wide range of backgrounds stand to benefit from the guidance in Efficient R Programming. Get advice for setting up an R programming environment Explore general programming concepts and R coding techniques Understand the ingredients of an efficient R workflow Learn how to efficiently read and write data in R Dive into data carpentry-the vital skill for cleaning raw data Optimize your code with profiling, standard tricks, and other methods Determine your hardware capabilities for handling R computation Maximize the benefits of collaborative R programming Accelerate your transition from R hacker to R programmer
Preface ix
1 Introduction
1(16)
Prerequisites
2(1)
Who This Book Is for and How to Use It
2(2)
What Is Efficiency?
4(1)
What Is Efficient R Programming?
4(2)
Why Efficiency?
6(1)
Cross-Transferable Skills for Efficiency
7(2)
Touch Typing
7(1)
Consistent Style and Code Conventions
8(1)
Benchmarking and Profiling
9(5)
Benchmarking
9(1)
Benchmarking Example
10(1)
Profiling
11(3)
Book Resources
14(1)
R Package
14(1)
Online Version
14(1)
References
14(3)
2 Efficient Setup
17(30)
Prerequisites
18(1)
Top Five Tips for an Efficient R Setup
18(1)
Operating System
18(3)
Operating System and Resource Monitoring
19(2)
R Version
21(4)
Installing R
22(1)
Updating R
23(1)
Installing R Packages
23(1)
Installing R Packages with Dependencies
24(1)
Updating R Packages
24(1)
R Startup
25(10)
R Startup Arguments
25(1)
An Overview of R's Startup Files
26(1)
The Location of Startup Files
27(1)
The .Rprofile File
28(1)
Example .Rprofile File
29(4)
The .Renviron File
33(2)
RStudio
35(8)
Installing and Updating RStudio
35(1)
Window Pane Layout
36(2)
RStudio Options
38(1)
Autocompletion
39(1)
Keyboard Shortcuts
40(1)
Object Display and Output Table
41(1)
Project Management
41(2)
BLAS and Alternative R Interpreters
43(3)
Testing Performance Gains from BLAS
44(1)
Other Interpreters
45(1)
Useful BLAS/Benchmarking Resources
46(1)
References
46(1)
3 Efficient Programming
47(22)
Prerequisites
47(1)
Top Five Tips for Efficient Programming
47(1)
General Advice
48(5)
Memory Allocation
49(1)
Vectorized Code
50(3)
Communicating with the User
53(3)
Fatal Errors: stop()
53(1)
Warnings: warning()
54(1)
Informative Output: message() and cat()
55(1)
Invisible Returns
55(1)
Factors
56(1)
Inherent Order
56(1)
Fixed Set of Categories
57(1)
The Apply Family
57(4)
Example: Movies Dataset
59(1)
Type Consistency
60(1)
Caching Variables
61(3)
Function Closures
63(1)
The Byte Compiler
64(3)
Example: The Mean Function
65(1)
Compiling Code
66(1)
References
67(2)
4 Efficient Workflow
69(16)
Prerequisites
69(1)
Top Five Tips for Efficient Workflow
70(1)
A Project Planning Typology
70(2)
Project Planning and Management
72(4)
Chunking Your Work
73(1)
Making Your Workflow SMART
74(1)
Visualizing Plans with R
75(1)
Package Selection
76(4)
Searching for R Packages
78(1)
How to Select a Package
78(2)
Publication
80(4)
Dynamic Documents with R Markdown
81(2)
R Packages
83(1)
Reference
84(1)
5 Efficient Input/Output
85(14)
Prerequisites
86(1)
Top Five Tips for Efficient Data I/O
86(1)
Versatile Data Import with rio
86(2)
Plain-Text Formats
88(5)
Differences Between fread() and read_csv()
90(2)
Preprocessing Text Outside R
92(1)
Binary File Formats
93(3)
Native Binary Formats: Rdata or Rds?
94(1)
The Feather File Format
94(1)
Benchmarking Binary File Formats
94(2)
Protocol Buffers
96(1)
Getting Data from the Internet
96(1)
Accessing Data Stored in Packages
97(1)
References
98(1)
6 Efficient Data Carpentry
99(28)
Prerequisites
100(1)
Top Five Tips for Efficient Data Carpentry
100(1)
Efficient Data Frames with tibble
100(2)
Tidying Data with tidyr and Regular Expressions
102(6)
Make Wide Tables Long with gather()
103(1)
Split Joint Variables with separate()
104(1)
Other tidyr Functions
105(1)
Regular Expressions
106(2)
Efficient Data Processing with dplyr
108(10)
Renaming Columns
110(1)
Changing Column Classes
110(1)
Filtering Rows
111(1)
Chaining Operations
112(2)
Data Aggregation
114(3)
Nonstandard Evaluation
117(1)
Combining Datasets
118(1)
Working with Databases
119(4)
Databases and dplyr
121(2)
Data Processing with data.table
123(2)
References
125(2)
7 Efficient Optimization
127(26)
Prerequisites
128(1)
Top Five Tips for Efficient Optimization
128(1)
Code Profiling
128(3)
Getting Started with profvis
129(1)
Example: Monopoly Simulation
130(1)
Efficient Base R
131(7)
The if() Versus ifelse() Functions
131(1)
Sorting and Ordering
132(1)
Reversing Elements
133(1)
Which Indices are TRUE?
133(1)
Converting Factors to Numerics
134(1)
Logical AND and OR
134(1)
Row and Column Operations
134(1)
is.na() and anyNA()
135(1)
Matrices
135(3)
Example: Optimizing the move_square() Function
138(1)
Parallel Computing
139(3)
Parallel Versions of Apply Functions
140(1)
Example: Snakes and Ladders
140(1)
Exit Functions with Care
141(1)
Parallel Code under Linux and OS X
141(1)
Rcpp
142(9)
A Simple C++ Function
143(1)
The cppFunction() Command
144(1)
C++ Data Types
145(1)
The sourceCpp() Function
145(1)
Vectors and Loops
146(3)
Matrices
149(1)
C++ with Sugar on Top
149(1)
Rcpp Resources
150(1)
References
151(2)
8 Efficient Hardware
153(10)
Prerequisites
153(1)
Top Five Tips for Efficient Hardware
153(1)
Background: What Is a Byte?
154(1)
Random Access Memory
155(3)
Hard Drives: HDD Versus SSD
158(1)
Operating Systems: 32-Bit or 64-Bit
159(1)
Central Processing Unit
160(2)
Cloud Computing
162(1)
Amazon EC2
162(1)
9 Efficient Collaboration
163(12)
Prerequisites
164(1)
Top Five Tips for Efficient Collaboration
164(1)
Coding Style
164(5)
Reformatting Code with RStudio
165(1)
Filenames
165(1)
Loading Packages
166(1)
Commenting
166(1)
Object Names
167(1)
Example Package
167(1)
Assignment
168(1)
Spacing
168(1)
Indentation
168(1)
Curly Braces
169(1)
Version Control
169(4)
Commits
170(1)
Git Integration in RStudio
170(1)
GitHub
171(1)
Branches, Forks, Pulls, and Clones
172(1)
Code Review
173(1)
References
174(1)
10 Efficient Learning
175(14)
Prerequisties
175(1)
Top Five Tips for Efficient Learning
175(1)
Using R's Internal Help
176(6)
Searching R for Topics
177(1)
Finding and Using Vignettes
178(1)
Getting Help on Functions
179(2)
Reading R Source Code
181(1)
swirl
182(1)
Online Resources
182(2)
Stack Overflow
183(1)
Mailing Lists and Groups
184(1)
Asking a Question
184(1)
Minimal Dataset
184(1)
Minimal Example
185(1)
Learning In Depth
185(2)
Spread the Knowledge
187(1)
References
187(2)
A Package Dependencies 189(2)
B References 191(6)
Index 197
Colin Gillespie is Senior lecturer (Associate professor) at Newcastle University, UK. He has been running R courses for over five years at a variety of levels, ranging from beginners to advanced programming. During his academic career, he has also been employed as an external consultant at Shell, Burberry, Yorkshire Bank, KPMG, and Tesco Bank. His research interests are high performance statistical computing and Bayesian statistics. Robin Lovelace is a Research Fellow in the Leeds Institute for Data Analytics, which specializes in the handling of large data sets. Robin has five years using R for academic research and three years teaching R at all levels. Robin developed the popular tutorial "Introduction to visualizing spatial data in R" and is working to publish "Spatial microsimulation with R" (CRC Press). Robin has used R on mission-critical contracts, including the creation of a nationally scalable interactive online mapping tool for the UK's Department for Transport (DfT).