• Complain

Mark Gardener - Beginning R: The Statistical Programming Language

Here you can read online Mark Gardener - Beginning R: The Statistical Programming Language full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2012, publisher: Wrox, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Mark Gardener Beginning R: The Statistical Programming Language
  • Book:
    Beginning R: The Statistical Programming Language
  • Author:
  • Publisher:
    Wrox
  • Genre:
  • Year:
    2012
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Beginning R: The Statistical Programming Language: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Beginning R: The Statistical Programming Language" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Conquer the complexities of this open source statistical language

R is fast becoming the de facto standard for statistical computing and analysis in science, business, engineering, and related fields. This book examines this complex language using simple statistical examples, showing how R operates in a user-friendly context. Both students and workers in fields that require extensive statistical analysis will find this book helpful as they learn to use R for simple summary statistics, hypothesis testing, creating graphs, regression, and much more. It covers formula notation, complex statistics, manipulating data and extracting components, and rudimentary programming.

  • R, the open source statistical language increasingly used to handle statistics and produces publication-quality graphs, is notoriously complex
  • This book makes R easier to understand through the use of simple statistical examples, teaching the necessary elements in the context in which R is actually used
  • Covers getting started with R and using it for simple summary statistics, hypothesis testing, and graphs
  • Shows how to use R for formula notation, complex statistics, manipulating data, extracting components, and regression
  • Provides beginning programming instruction for those who want to write their own scripts

Beginning R offers anyone who needs to perform statistical analysis the information necessary to use R with confidence.

Mark Gardener: author's other books


Who wrote Beginning R: The Statistical Programming Language? Find out the surname, the name of the author of the book and a list of all author's works by series.

Beginning R: The Statistical Programming Language — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Beginning R: The Statistical Programming Language" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Appendix
Answers to Exercises

This appendix provides the solutions for the end-of-chapter exercises located in Chapters 112.

Chapter 1
Exercise 1 Solution

To install the coin library/package you need to type the following command:

>install.package(coin)

Note that the name must be in quotes. Then you select the closest mirror site and the package is downloaded and installed for you.

Exercise 2 Solution

To load the coin library and make it ready to use you type the following:

>library(coin)

Once the library is active its commands are available for you to use. You can try to bring up the help entry for the package using the following:

>help(coin)

This does not work for all packages; a better alternative is to use the HTML help system by typing:

>help.start()

This opens the main R help files in your default browser. You can now follow the links to the packages and then find coin from the list.

Exercise 3 Solution

The MASS package is already loaded as part of the R installation but is not ready to use until you type:

>library(MASS)

Once you have the library available you can open the help entry using:

>help(bcv)
Exercise 4 Solution

You can use the search( ) command to get a list of objects that are available for use.

Exercise 5 Solution

To clear the coin package from memory (and remove it from the search( ) path), type the following:

>detach(package:coin)
Chapter 2
Exercise 1 Solution

You can use either the c( ) command or the scan() command to enter these data. The problem is that the bee names contain spaces, which are not allowed. You must alter the names to remove the spaces; the period is the simplest solution.

If you decided to use the c( ) command then the first vector would be created like so:

> Buff.tail = c(10, 1, 37, 5, 12)

If you decided to use the scan( ) command then the process is in two parts. The first part is to initiate the data entry like so:

> Buff.tail = scan()

The second part is to enter the data:

> 10 1 37 5 12

To finish the data entry process you must enter a blank line.

If you decide to use the c( ) command, the entire data entry process would look like the following:

> Buff.tail = c(10, 1, 37, 5, 12)> Garden.bee = c(8, 3, 19, 6, 4)> Red.tail = c(18, 9, 1, 2, 4)> Honey.bee = c(12, 13, 16, 9, 10)> Carder.bee = c(8, 27, 6, 32, 23)
Exercise 2 Solution

You can use the ls( ) command to list all the objects currently in memory. However, there will often be quite a few other objects so you can narrow your display by using a regular expression like so:

> ls(pattern = 'tail|bee')

Note that you must not include a space on either side of the | pipe character. This listing shows all objects that contain tail or bee. You could also list objects that ended with tail or bee by adding the dollar sign as a suffix like so:

> ls(pattern = '.tail$|.bee$')

To save the data objects you can use the save( ) command. The names of the objects could be typed into the command to make a long listing, but this is tedious. The regular expression you typed earlier can be used to produce the list of objects to be saved like so:

> save(list = ls(pattern = 'tail|bee'), file = 'bee data all.RData')

To remove the unwanted individual vectors you need to use the rm( ) command. The names of the objects could be typed into the command as a list or the regular expression could be used once again. This time you must ensure that you do not remove the bees data frame so type the ls( ) command first to check:

> ls(pat = 'tail$|bee$')

Now the $ suffix ensures that you only selected those objects that ended with the text. You can use the up arrow to recall the command and edit it to form the rm( ) command like so:

> rm(list = ls(pat = 'tail$|bee$'))

Note that you must use the list = instruction to ensure that the result of the ls( ) part is treated like a list.

Now quit R using the q( ) command and select No when asked of you want to save the workspace. Restart R and use the ls( ) command once again. All the bee data are gone. To retrieve the data you use the load( ) command.

> load(bee data all.RData)

This command retrieves the data that you saved earlier; the individual vectors that you made are all included in the one file. If you are using Windows or Macintosh you can also use the file.choose( ) instruction rather than the explicit filename like so:

> load(file.choose())

You can also load the data by double clicking on the appropriate file from a Windows Explorer or Mac Finder window.

Chapter 3
Exercise 1 Solution

You can use either the c( ) command or the scan() command to enter these data. The problem is that the bee names contain spaces, which are not allowed. You must alter the names to remove the spaces; the period is the simplest solution.

If you decided to use the c( ) command then the first vector would be created like so:

> Buff.tail = c(10, 1, 37, 5, 12)

If you decided to use the scan( ) command then the process is in two parts. The first part is to initiate the data entry like so:

> Buff.tail = scan()

The second part is to enter the data:

> 10 1 37 5 12

To finish the data entry process you must enter a blank line.

If you decide to use the c( ) command the entire data entry process would look like the following:

> Buff.tail = c(10, 1, 37, 5, 12)> Garden.bee = c(8, 3, 19, 6, 4)> Red.tail = c(18, 9, 1, 2, 4)> Honey.bee = c(12, 13, 16, 9, 10)> Carder.bee = c(8, 27, 6, 32, 23)

To create a data frame you must decide on a name for the object and then use the data.frame( ) command like so:

> bees = data.frame(Buff.tail, Garden.bee, Red.tail, Honey.bee, Carder.bee)

To create row names you can use either the row.names( ) or rownames() command. The plant names also contain spaces, which need to be dealt with as before by replacing with a full stop. The shortest method is to assign the names as a simple list of data like so:

> row.names(bees) = c('Thistle', 'Vipers.bugloss', 'Golden.rain', 'Yellow.alfalfa', 'Blackberry')

You might also decide to create a vector to hold the plant names as a separate object:

> plant.names = c('Thistle', 'Vipers.bugloss', 'Golden.rain', 'Yellow.alfalfa', 'Blackberry')> row.names(bees) = plant.names

This last method is slightly longer but the vector of plant names can be useful for other purposes.

Exercise 2 Solution

To make a matrix you need the data as separate columns (or rows) or as a single vector of values. You already have the separate vectors for the different bees so begin by using the cbind( ) command to join them column by column into a new matrix:

> beematrix = cbind(Buff.tail, Garden.bee, Red.tail, Honey.bee, Carder.bee)

Your new matrix will not contain any row names so to include them you need to use the rownames( ) command:

> plant.names = c('Thistle', 'Vipers.bugloss', 'Golden.rain', 'Yellow.alfalfa', 'Blackberry')> rownames(beematrix) = plant.names

The second way to create a matrix is to use a single vector of values and use the matrix( ) command. To create a single vector you could combine the individual bee vectors:

> bee.data = c(Buff.tail, Garden.bee, Red.tail, Honey.bee, Carder.bee)
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Beginning R: The Statistical Programming Language»

Look at similar books to Beginning R: The Statistical Programming Language. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Beginning R: The Statistical Programming Language»

Discussion, reviews of the book Beginning R: The Statistical Programming Language and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.