R 4 Quick Syntax Reference: A Pocket Guide to the Language, API’s and Library, 3rd Edition
- Length: 618 pages
- Edition: 3
- Language: English
- Publisher: Apress
- Publication Date: 2022-03-30
- ISBN-10: 1484279239
- ISBN-13: 9781484279236
- Sales Rank: #2368074 (See Top 100 Books)
This handy reference book detailing the intricacies of R covers version 4.x features, including numerous and significant changes to syntax, strings, reference counting, grid units, and more.
Starting with the basic structure of R, the book takes you on a journey through the terminology used in R and the syntax required to make R work. You will find looking up the correct form for an expression quick and easy. Some of the new material includes information on RStudio, S4 syntax, working with character strings, and an example using the Twitter API.
With a copy of the R 4 Quick Syntax Reference in hand, you will find that you are able to use the multitude of functions available in R and are even able to write your own functions to explore and analyze data.
What You Will Learn
- Discover the modes and classes of R objects and how to use them
- Use both packaged and user-created functions in R
- Import/export data and create new data objects in R
- Create descriptive functions and manipulate objects in R
- Take advantage of flow control and conditional statements
- Work with packages such as base, stats, and graphics
Who This Book Is For
Those with programming experience, either new to R, or those with at least some exposure to R but who are new to the latest version.
Table of Contents About the Author About the Technical Reviewer Acknowledgments Introduction Chapter 1: Downloading R and RStudio and Setting Up a File System Downloading R and RStudio The Windows Systems The macOS Systems The Linux Systems RStudio Installing and Updating Packages The Windows Systems The macOS Systems The Linux Systems Updating R All Systems The macOS Systems Using R in Separate Folders Projects in RStudio The Windows Systems The macOS Systems The Linux Systems Chapter 2: The R Prompt and the RStudio Main Menus and Subwindows The Three Parts of R: Objects, Operators, and Assignments The R Prompt An Example of a Calculation The Main Menus and the Four Subwindows in RStudio The Main Menus The First Subwindow The Second Subwindow The Third Subwindow The Fourth Subwindow Chapter 3: Assignments and Operators Types of Assignment Example of Three Types of Assignment Listing and Removing Objects in RStudio and R Operators Logical Operators and Functions Arithmetic Operators Matrix Operators and Functions Relational Operators Subscripting Operators Vectors Matrices Arrays Lists Other Types Odds and Ends Chapter 4: Types and Modes of Objects Overview of the Types and Modes Commonly Used Types Atomic, Recursive, Language, and S4 Kinds Some Functions for the Atomic Kind of Types The NULL Type The Raw Type The Logical Type The Integer or Double Types and the Numeric Mode The Complex Type The Character Type The Common Recursive Kind of Types The List Type The Closure, Special, and Builtin Types The Environment Type The S4 Type The Less Common Types The Language Kind of Objects Notes Chapter 5: Classes of Objects Some Basics on Classes Vectors Some Common S3 Classes The Matrix Class: matrix The Array Class: array Names for Vectors, Matrices, Arrays, and Lists The Data Frame Class: data.frame The Time Series Classes: ts and mts The Factor Classes: factor and ordered The Date and Time Classes: Date, POSIXct, POSIXlt, and difftime The Formula Class: formula The S4 Class Reference Classes Chapter 6: Packaged Functions The Libraries Loading and Removing Packages Default Packages and Primitive Functions Using the Help Pages Identifier Title Description Usage Arguments Details Value Some Other Optional Sections References See Also Examples Chapter 7: Scripts, User-Created Functions, and S4 and Reference Class Methods Scripts The Structure of a Function How to Enter a Function into R In RStudio Using an Editor Inline Entry An Outside Editor: dget() and Copying and Pasting S4 Methods Reference Class Methods Chapter 8: How to Use a Script or Function Example of a Script: Mining Twitter Calling a Function Arguments The Output from a Function Chapter 9: Importing and Creating Data Reading Data into RStudio and R, Including R Datasets Connections file() url() gzfile(), bzfile(), and xzfile() unz() pipe() fifo() socketConnection(), serverSocket(), and serverAccess() The Other Arguments to the Connection Functions open(), close(), isOpen(), isIncomplete(), and socketTimeout0() showConnections(), getConnections(), and closeAllConnections() stdin(), nullfile(), and isatt() make.socket(), gzcon(), and pushback() seek(), isSeekable(), and truncate() Reading Data Using RStudio The scan() Function The read.table() and Related Functions The readLines(), read.socket(), readClipboard(), and readline() Functions The dget() and source() Functions The loadhistory() Function Some Other Functions That Read Textual Data The load() and attach() Functions The readRDS() Function The readBin(), readChar(), and unserialize() Functions R Datasets and the library(), attach(), and data() Functions Probability Distributions and the Function sample() Probability Distributions The sample() Function Manually Entering Data and Generating Data with Patterns The c() Function The seq() and rep() Functions The seq() Function The rep() Function Combinatorics and Grid Expansion The paste() and paste0() Functions Chapter 10: Exporting from R Connection Functions That Write The sink() Function The cat() and write() Functions The write.table() and Related Functions The writeLines(), write.socket(), and writeClipboard() Functions The dput() and dump() Functions The savehistory() Function The save() and save.image() Functions The saveRDS() Function The writeBin(), writeChar(), and serialize() Functions Matching Importing and Exporting Functions Other Exporting Functions Chapter 11: Descriptive Functions and Manipulating Objects Descriptive Functions The dim() Function The nrow(), ncol(), NROW(), and NCOL() Functions The length() Function The nchar() and nzchar() Functions Manipulating Objects The cbind(), rbind(), cbind2(), and rbind2() Functions The Apply Functions The apply() Function The lapply(), sapply(), vapply(), and rapply() Functions The lapply() Function The sapply() Function The vapply() Function The rapply() Function The tapply() Function The mapply() Function The eapply() Function The sweep() and scale() Functions The sweep() Function The scale() Function The aggregate(), table(), tabulate(), and ftable() Functions The aggregate() Function Data Frames Formulas Time Series The table(), as.table(), and is.table() Functions The tabulate() Function The ftable() Function Some Character String Functions The grep Functions Functions to Manipulate Case in Character Strings The substr(), substring(), and strsplit() Functions Chapter 12: Flow Control Brackets “{}” and the Semicolon “;” The “if” and “if/else” Control Statements The “while” Control Statement The “for” Control Statement The “repeat” Control Statement The Statements “break” and “next” Nesting Chapter 13: Examples of Flow Control Nested “for” Loops with an “if/else” Statement Using Indices A “while” Loop Using Indices Nested “for” Loops Using Indices A “for” Loop, “if” Statement, and “next” Statement Using Indices A “for” Loop, a “repeat” Loop, an “if” Statement, and a “break” Statement Using Indices Chapter 14: The ifelse() and switch() Functions The ifelse() Function The switch() Function Chapter 15: Some Common Functions The options() Function The round(), signif(), and noquote() Functions The round() Function The signif() Function The noquote() Function The format(), print(), and plot() Functions The format() Function The print() Function The plot() Function The eval(), attributes(), attr(), and summary() Functions The eval() Function The attributes() and attr() Functions The summary() Function The deriv(), numericDeriv(), and integrate() Functions The deriv() and Related Functions The numericDeriv() Function The integrate() Function The parse() and deparse() Functions The parse() Function The deparse() Function Some Functions for Models: anova(), coef(), effects(), residuals(), fitted(), vcov(), confint(), and predict() Index
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/Apress
2. In the Find a repository… box, search the book title: R 4 Quick Syntax Reference: A Pocket Guide to the Language, API’s and Library, 3rd Edition
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.