An Introduction to R
279 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

An Introduction to R , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
279 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

The modern world is awash with data. The R Project is a statistical environment and programming language that can help to make sense of it all. A huge open-source project, R has become enormously popular because of its power and flexibility. With R you can organise, analyse and visualise data. This clear and methodical book will help you learn how to use R from the ground up, giving you a start in the world of data science.


Learning about data is important in many academic and business settings, and R offers a potent and adaptable programming toolbox. The book covers a range of topics, including: importing/exporting data, summarising data, visualising data, managing and manipulating data objects, data analysis (regression, ANOVA and association among others) and programming functions. Regardless of your background or specialty, you'll find this book the perfect primer on data analysis, data visualisation and data management, and a springboard for further exploration.


1. A brief introduction to R

2. Basic math

3. Introduction to R objects

4. Making and importing data objects

5. Managing and exporting data objects

6. R object types and their properties

7. Working with data objects

8. Manipulating data objects

9. Summarizing data

10. Tabulation

11. Graphics: basic charts

12. Graphics: adding to plots

13. Graphics: advanced methods

14. Analyze data: statistical analyses

15. Programming tools

Appendix

Index

Sujets

Informations

Publié par
Date de parution 23 mai 2023
Nombre de lectures 4
EAN13 9781784273392
Langue English

Informations légales : prix de location à la page 0,2500€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

An Introduction to R
An Introduction to R: Data Analysis and Visualization

Mark Gardener
Pelagic Publishing
Published by Pelagic Publishing
20–22 Wenlock Road
London N1 7GU, UK
www.pelagicpublishing.com
An Introduction to R: Data Analysis and Visualization
Copyright © 2023 Mark Gardener
The moral rights of the author have been asserted by him in accordance with the Copyright, Designs and Patents Act 1988.
All rights reserved. Apart from short excerpts for use in research or for reviews, no part of this document may be printed or reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, now known or hereafter invented or otherwise without prior permission from the publisher.
A CIP record for this book is available from the British Library
ISBN 978-1-78427-337-8 Hbk
ISBN 978-1-78427-338-5 Pbk
ISBN 978-1-78427-339-2 ePub
ISBN 978-1-78427-340-8 PDF
https://doi.org/10.53061/THEE2596
Typeset by Deanta Global Publishing Services, Chennai, India
About this book
The modern world is awash with data. The R Project is a statistical environment and programming language that can help to make sense of these data. R is a huge Open Source project that has become enormously popular over the past few years. The rise of R is due to its power and flexibility. With R you can organize, analyze and visualize data. This book will help you learn how to use R from the ground up, giving you a start in the world of Data Science.
Acknowledgements
My thanks go to Richard Rowe, for introducing me to R all those years ago. Also, many thanks to Pelagic Publishing for being so fun and easy to work with, this book would not have been possible without their help. Thank you to all those students, who have kept me on my toes, much of this material has been “tried out” in a classroom somehow. Finally, a big thank you to the R Core Project team for their continuing great work in keeping R going.
Who this book is for
This book is an introduction to using R: The Statistical Programming Language. Regardless of your background or specialty – science, business, engineering, or social science – you’ll find this book a starting point for learning about Data Science, that is, Data Analysis, Data Visualization, and Data Management. This book is not aimed at any particular educational level and should be accessible to anyone who wants to learn R, a powerful and flexible analytical toolbox.
What you will learn
In this book you will learn how to use the R program. You’ll learn how to get started with R, in particular: making and importing data items exporting data managing and manipulating data objects summarizing and aggregating data visualizing data the basics of Data Analysis, including: differences tests correlation association regression R programming functions
This book is intended as a foundation course in using R for Data Science and a springboard for further exploration into Data Analysis and Data Visualization. Not every R command is shown (there are so many!), and the emphasis is on those that the author deemed most useful. I apologize in advance if you are an R user already, and your favorite function is missing.
Some R functions have lots of potential arguments, and not all of these have been illustrated, in order to make the learning journey simpler. Only the most “helpful” arguments are shown but you will see clearly if there are additional arguments you can use (you’ll see as you read the book how easy it is to access the internal help system of R).
Author Biography
Mark is a scientist, lecturer and author. He likes to “tell stories with data”, and he also likes to tell other people how to do that. It all started when Mark was at University studying Natural Sciences (as opposed to un-natural ones), and then later whilst doing a PhD in Ecology and Evolutionary Biology. Ecological data is really messy, which makes it fun but also frustrating. Mark discovered R at the end of his doctoral research, and the discovery sparked an interest in continuing to tell stories that continues to this day. Nowadays he writes textbooks and teaches people about Data Science (not just ecologists, but also people who earn their living indoors).
Mark enjoys fly-fishing and American Football, but not simultaneously. He currently lives in Sussex, with his wife, Christine, a biochemist.

Data Examples
All the examples in this book are from R itself. Many are from the basic datasets that come with R. Some are from the package: MASS , which comes with R but is not loaded by default. To load the package use:
library(MASS)
Support Material
Support material online can be found at the author’s website. Visit: https://www.gardenersown.co.uk and follow links to Publications or Resources . In the text you’ll also find some references to additional material, which will be indicated by the ↘ icon.
How this Book is Arranged
The chapters are laid out in what I thought was a sensible order, however it is nearly impossible to take a straight path and some ducking and diving was necessary at times. I hope you find the layout reasonably logical. Each chapter has a brief introduction giving an idea of what’s to follow. Each chapter ends with a concise summary and some simple exercises (answers in the Appendix). I have tried to include plenty of examples and all the data is from within R itself, so there is no need to download anything else.

Notes and Tips:
At various points you’ll see Note and Tip sections, giving some explicit information that I felt was important at the time.
Contents
1 A brief introduction to R
2 Basic math
3 Introduction to R objects
4 Making and importing data objects
5 Managing and exporting data objects
6 R object types and their properties
7 Working with data objects
8 Manipulating data objects
9 Summarizing data
10 Tabulation
11 Graphics: basic charts
12 Graphics: adding to plots
13 Graphics: advanced methods
14 Analyze data: statistical analyses
15 Programming tools
 Appendix
  Index
1. A brief introduction to R
The R program is a free Open Source statistical environment. R is a programming language that carries out statistical computing and can produce high quality graphics. R can run on all major operating systems, e.g. Windows, Apple Macintosh and most Linux distributions. R started as an academic exercise at the University of Auckland in New Zealand. Now R has become a much larger international project with many people contributing to it.
R is highly customizable, and is now used by business, corporations, governments, academics and individuals around the world. R is used for many data science purposes; these might be as simple as adding together a few numbers, or more complicated multivariate statistical modelling.

What’s in this chapter Obtaining and installing R Introduction to the R interface Getting help in and about R Extending R with additional command packages Alternative ways to run R
In short, this chapter is about getting and starting to use R.

Note: Support material
See the ↘ for links to material on the support website.
1.1 Getting R
You can get R from the R Project website at https://www.r-project.org where you will find the download page (Figure 1.1).

Figure 1.1 The installation page of the R website.
Click on the appropriate link for your operating system and you’ll be on your way. Once R is installed on your computer you will be able to run the program. If you use a Linux system, R runs via the terminal. On Windows or Macintosh you will find R like any other program.
1.2 The R interface
The main interface between R and you is the R console (Figure 1.2). When you run R this is what you’ll see first. The console displays a “welcome” message and some additional “blurb”, then waits for you.

Figure 1.2 The R console in Windows.
The console is where you will type the commands required to “drive” R. You start typing at the > symbol. In the GUI (for Windows or Macintosh) there are some menus, which can help make using R a little easier (e.g. Figure 1.3).

Figure 1.3 The File menu in the Windows GUI.
The Packages menu for example (Figure 1.4) allows you to manage additional R command packages, which allow you to extend the (already extensive) capabilities of R.

Figure 1.4 The Packages menu in the Windows GUI.
If you produce any graphical output, this will appear in a separate window.

Tip: Command History
Use the ↑ to scroll back through previous R commands.
1.2.1 The help system
So, you are staring at the R welcome message and wondering what to type … there is plenty of help available in R but it can be hard to find what you want if you do not know the command name that you want help for!
In the Windows GUI version of R the main help system is displayed in your web browser (Figure 1.5). On a Macintosh the help system opens in a browser-like window, whereas in Linux the help entries are displayed directly in the console itself.

Figure 1.5 The R Help starting page in a web browser.
You can access the help entry for a command using the help() function. This works nicely if you know the name of the function for which you want help. You put the name of the function (in quotes) in the () brackets.
help( "sum" )
As a short-cut you can use ?name , where name is the name of the function (you do not need quotes).
?mean
If you do not recall the name of the function, but you think you know a bit of it, you can try apropos("partname") , where "partname" is the part you can recall, for example:
apropos( "qq" )
[1] "qqline" "qqnorm" "qqplot"
The result of apropos() is to show you all the functions that contain the "partword" you typed.
You can “force” R to open the help system in your default web browser using help.start() . This will open the starting page for the help system (Figure 1.5), regardless of the operating system you are using. Note that you do not need

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents