Modern R Programming Cookbook: Recipes to simplify your statistical applications (English Edition)
Book information
Description
Key FeaturesDevelop strategies to speed up your R codeTackle programming problems and explore both functional and object-oriented programming techniquesLearn how to address the core problems of programming in R with the most popular R packages for common tasksBook Description R is a powerful tool for statistics, graphics, and statistical programming. It is used by tens of thousands of people daily to perform serious statistical analyses. It is a free, open source system whose implementation is the collective accomplishment of many intelligent, hard-working people. There are more than 2,000 available add-ons, and R is a serious rival to all commercial statistical packages. The objective of this book is to show how to work with different programming aspects of R. The emerging R developers and data science could have very good programming knowledge but might have limited understanding about R syntax and semantics. Our book will be a platform develop practical solution out of real world problem in scalable fashion and with very good understanding. You will work with various versions of R libraries that are essential for scalable data science solutions. You will learn to work with Input / Output issues when working with relatively larger dataset. At the end of this book readers will also learn how to work with databases from within R and also what and how meta programming helps in developing applications. What you will learnInstall R and its various IDE for a given platform along with installing libraries from different repositories and version controlLearn about basic data structures in R and how to work with themWrite customized R functions and handle recursions, exceptions in R environmentsCreate the data processing task as a step by step computer program and execute using dplyrExtract and process unstructured text dataInteract with database management system to develop statistical applicationsFormulate and implement parallel processing in RAbout the Author Jaynal Abedin is currently doing research as a PhD student at Unit for Biomedical Data Analytics (BDA) of INSIGHT at the National University of Ireland Galway. His research work is focused on the sports science and sports medicine area in a targeted project with ORRECO --an Irish startup company that provides evidence-based advice to individual athletes through biomarker and GPS data. Before joining INSIGHT as a PhD student he was leading a team of statisticians at an international public health research organization (icddr,b). His primary role there was to develop internal statistical capabilities for researchers who come from various disciplines. He was involved in designing and delivering statistical training to the researchers. He has a bachelors and masters degree in statistics, and he has written two books in R programming: Data Manipulation with R and R Graphs Cookbook (Second Edition) with Packt. His current research interests are predictive modeling to predict probable injury of an athlete and scoring extremeness of multivariate data to get an early signal of an anomaly. Moreover, he has an excellent reputation as a freelance R programmer and statistician in an online platform such as upwork. Table of ContentsInstalling and Configuring R and its Libraries Data Structures in R Writing Customized Functions Conditional and Iterative Operations R Objects and Classes Querying, Filtering, and Summarization R for Text Processing R and Databases Parallel Processing in R Cover Copyright Credits About the Author About the Reviewer www.PacktPub.com Customer Feedback Table of Contents Preface Chapter 1: Installing and Configuring R and its Libraries Introduction Installing and configuring base R in Windows Getting ready How to do it... How it works... There's more... See also Installing and configuring base R in Linux Getting ready How to do it... There's more... See also Installing and configuring RStudio IDE in Windows Getting ready How to do it… How it works… There's more… See also Installing and configuring RStudio IDE in Linux Getting ready How to do it… How it works... See also Installing and configuring R tools for Visual Studio in Windows Getting ready How to do it… How it works… See also Installing R libraries from various sources Getting ready How to do it… The ggplot2 library The devtools library Installing a library from GitHub Installing a library from the BioC repository How it works… There's more… See also Installing a specific version of R library Getting ready How to do it… How it works… Chapter 2: Data Structures in R Introduction Creating a vector and accessing its properties Getting ready How to do it… How it works… There's more… See also Creating a matrix and accessing its properties Getting ready How to do it… How it works… There's more… See also Creating a data frame and accessing its properties Getting ready How to do it… How it works… There's more… See also Creating an array and accessing its properties Getting ready How to do it… How it works… There's more… See also Creating a list from a combination of vector, matrix, and data frame Getting ready How to do it… How it works… There's more… See also Converting a matrix to a data frame and a data frame to a matrix Getting ready How to do it… How it works… There's more… See also Chapter 3: Writing Customized Functions Introduction Writing your first function in R Getting ready How to do it… How it works… There’s more… Writing functions with multiple arguments and use of default values Getting ready How to do it… How it works… There’s more… Handling data types in input arguments Getting ready How to do it… How it works… There’s more… Producing different output types and return values Getting ready How to do it… How it works… There’s more… Making a recursive call to a function Getting ready How to do it… How it works… There’s more… Handling exceptions and error messages Getting ready How to do it… How it works… There’s more… See also Chapter 4: Conditional and Iterative Operations Introduction The use of the if conditional statement Getting ready How to do it… How it works… There’s more… The use of the if…else conditional operator Getting ready How to do it… How it works… There’s more… The use of the ifelse vectorised conditional operator Getting ready How to do it… How it works… There’s more… See also Writing a function using the switch operator Getting ready How to do it… How it works… There’s more… Comparing the performance of switch and series of the if…else statements Getting ready How to do it… How it works… Using for loop for iterations Getting ready How to do it… How it works… Vectorised operation versus for loop Getting ready How to do it… How it works… Chapter 5: R Objects and Classes Introduction Defining a new S3 class Getting ready How to do it… How it works… There's more… See also Defining methods for the S3 class Getting ready How to do it… How it works… There's more… See also Creating a generic function and defining a method for the S3 class Getting ready How to do it… How it works… There's more… Defining a new S4 class Getting ready How to do it… How it works… There's more… See also Defining methods for an S4 class Getting ready How to do it… How it works… There's more… See also Creating a function to return an object of the S4 class Getting ready How to do it… How it works… There's more… See also Chapter 6: Querying, Filtering, and Summarizing Introduction Using the pipe operator for data processing Getting ready How to do it… How it works… There's more… See also Efficient and fast summarization using the dplyr verbs Getting ready How to do it… How it works… There's more… See also Using the customized function within the dplyr verbs Getting ready How to do it... How it works... There's more… See also Using the select verb for data processing Getting ready How to do it... How it works... There's more… See also Using the filter verb for data processing Getting ready How to do it... How it works... Using the arrange verb for data processing Getting ready How to do it... How it works... There's more… Using mutate for data processing Getting ready How to do it... How it works... There's more… Using summarise to summarize dataset Getting ready How to do it... How it works... Chapter 7: R for Text Processing Introduction Extracting unstructured text data from a plain web page Getting ready How to do it… How it works… There’s more… Extracting text data from an HTML page Getting ready How to do it… How it works… There's more… Extracting text data from an HTML page using the XML library Getting ready How to do it… How it works… Extracting text data from PubMed Getting ready How to do it… How it works… There's more… Importing unstructured text data from a plain text file Getting ready How to do it… How it works… There's more… Importing plain text data from a PDF file Getting ready How to do it… How it works… There's more… Pre-processing text data for topic modeling and sentiment analysis Getting ready How to do it… How it works… There's more… Creating a word cloud to explore unstructured text data Getting ready How to do it… How it works… There's more… Using regular expression in text processing Getting ready How to do it… How it works… There's more… Chapter 8: R and Databases Introduction Installing the PostgreSQL database server Getting ready How to do it… How it works… Creating a new user in the PostgreSQL database server Getting ready How to do it… How it works… There's more… See also Creating a table in a database in PostgreSQL Getting ready How to do it... How it works… There's more… Creating a dataset in PostgreSQL from R Getting ready How to do it... How it works... Interacting with the PostgreSQL database from R Getting ready How to do it… How it works… There's more... Creating and interacting with the SQLite database from R Getting ready How to do it... How it works... There's more… Chapter 9: Parallel Processing in R Introduction Creating an XDF file from CSV input Getting ready How to do it… How it works… There's more… See also Processing data as a chunk Getting ready How to do it… How it works… There's more… See also Comparing computation time with data frame and XDF Getting ready How to do it… How it works… There's more… Linear regression with larger data (rxFastLiner) Getting ready How to do it… How it works… There's more… See also Index
Similar books
Data Manipulation with R
2014 · PDF
Modern R Programming Cookbook: Recipes to simplify your statistical applications
2017 · MOBI
Modern R Programming Cookbook: Recipes to simplify your statistical applications (English Edition)
2017 · EPUB
Modern R Programming Cookbook
2017 · PDF
Modern R Programming Cookbook Recipes to Simplify Your Statistical Applications
2017 · PDF
Data Manipulation with R: Perform group-wise data manipulation and deal with large datasets using R efficiently and effectively
2014 · PDF
Data Manipulation with R, 2nd Edition: Efficiently perform data manipulation using the split-apply-combine strategy in R
2015 · PDF
R Graphs Cookbook
2015 · PDF