R Quick Syntax Reference by Margot Tollefson
Author:Margot Tollefson
Language: eng
Format: epub, pdf
ISBN: 9781484244050
Publisher: Apress
R Datasets
Many of the packages in R come with datasets. Some of these datasets are found in the package datasets, which is one of the packages installed by default in R. To access datasets from the package datasets, enter library(datasets) at the R prompt or check the box to the left of datasets under the “Packages” tab in R Studio. To see the datasets in datasets, enter library(help=datasets) at the R prompt or select datasets under the “Packages” tab. Once the library is loaded, the datasets in datasets are accessible.
You can also use the function attach() to get access to a dataset in a library without loading the library. Both the package and the dataset names are required, separated by two colons and unquoted, for example, attach(datasets::attitude). Attached datasets should be detached after you are done with them, for example, detach(datasets::attitude).
For any library, once the library is loaded, the datasets in the library are accessible like any other object in the workspace. A dataset can be an atomic object, a data.frame, or a list. The function attach() gives an error if the dataset is not a data frame or list, but the object is available just by using the name of the object if the library is loaded. In R Studio, the datasets do not appear under the “Environment” tab, however, so the datasets are not in the workspace. Use the data() function to load the data into the workspace, as seen previously.
The attach() function attaches into a certain position in the workspace. R searches for objects through positions in the workspace. Position one is the workspace. The first attach() call attaches in position two, the second position three, and so on. A position may be specified in the call. R uses the first object with the name that it finds, starting with position one.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Computer Vision & Pattern Recognition | Expert Systems |
Intelligence & Semantics | Machine Theory |
Natural Language Processing | Neural Networks |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven Development with Java by Alan Mellor(6709)
Data Augmentation with Python by Duc Haba(6616)
Principles of Data Fabric by Sonia Mezzetta(6372)
Learn Blender Simulations the Right Way by Stephen Pearson(6267)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6134)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5531)
Big Data Analysis with Python by Ivan Marin(5354)
The Infinite Retina by Robert Scoble Irena Cronin(5226)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5144)
Pretrain Vision and Large Language Models in Python by Emily Webber(4315)
Infrastructure as Code for Beginners by Russ McKendrick(4076)
Functional Programming in JavaScript by Mantyla Dan(4038)
The Age of Surveillance Capitalism by Shoshana Zuboff(3946)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3790)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3592)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3568)
