The Essential R Reference
eBook - ePub

The Essential R Reference

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

The Essential R Reference

About this book

An essential library of basic commands you can copy and paste into R

The powerful and open-source statistical programming language R is rapidly growing in popularity, but it requires that you type in commands at the keyboard rather than use a mouse, so you have to learn the language of R. But there is a shortcut, and that's where this unique book comes in. A companion book to Visualize This: The FlowingData Guide to Design, Visualization, and Statistics, this practical reference is a library of basic R commands that you can copy and paste into R to perform many types of statistical analyses.

Whether you're in technology, science, medicine, business, or engineering, you can quickly turn to your topic in this handy book and find the commands you need.

  • Comprehensive command reference for the R programming language and a companion book to Visualize This: The FlowingData Guide to Design, Visualization, and Statistics
  • Combines elements of a dictionary, glossary, and thesaurus for the R language
  • Provides easy accessibility to the commands you need, by topic, which you can cut and paste into R as needed
  • Covers getting, saving, examining, and manipulating data; statistical test and math; and all the things you can do with graphs
  • Also includes a collection of utilities that you'll find useful

Simplify the complex statistical R programming language with The Essential R Reference.

.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access The Essential R Reference by Mark Gardener in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Science General. We have over one million books available in our catalogue for you to explore.

Information

Theme 1: Data

R is an object-oriented language; that means that it deals with named objects. Most often these objects are the data that you are analyzing. This theme deals with making, getting, saving, examining, and manipulating data objects.
Topics in this Theme
  • Data Types
  • Creating Data
  • Importing Data
  • Saving Data
  • Viewing Data
  • Summarizing Data
  • Distribution of Data
Commands in this Theme:
[]
$
addmargins
aggregate
apply
array
as.data.frame
as.xxxx
attach
attr
attributes
c
case.names
cbind
character
class
colMeans
colnames
colSums
comment
cummax
cummin
cumprod
cumsum
data
data.frame
detach
dget
dim
dimnames
dir
dput
droplevels
dump
dxxxx
ecdf
factor
file.choose
fivenum
ftable
getwd
gl
head
inherits
integer
interaction
IQR
is
is.xxxx
lapply
length
levels
list
list.files
load
logical
ls
ls.str
lsf.str
mad
margin.table
matrix
mean
median
mode
names
NCOL
ncol
nlevels
NROW
nrow
numeric
objects
order
prop.table
ptukey
pxxxx
qtukey
quantile
qxxxx
range
rank
raw
rbind
read.csv
read.csv2
read.delim
read.delim2
read.spss
read.table
read.xls
read.xlsx
relevel
remove
reorder
resample
rep
rm
RNGkind
row.names
rowMeans
rownames
rowsum
rowSums
rxxxx
sample
sapply
save
save.image
scan
sd
search
seq
seq_along
seq_len
set.seed
setwd
sort
source
storage.mode
str
subset
sum
summary
sweep
table
tabulate
tail
tapply
ts
typeof
unclass
unlist
var
variable.names
vector
View
which
with
within
write
write.csv
write.csv2
write.table
xtabs
/Level1

Data Types

R recognizes many kinds of data, and these data can be in one of several forms. This topic shows you the commands relating to the kinds of data and how to switch objects from one form to another.
What’s In This Topic:
  • Types of data
  • The different types/forms of data objects
  • Creating blank data objects
  • Altering data types
  • Switching data from one type to another
  • Testing data types
  • How to tell what type an object is

Types of Data

Data can exist as different types and forms. These have different properties and can be coerced from one type/form into another.

Command Name

array
An array is a multidimensional object.
start feature
r-glass.eps
SEE drop for reducing dimensions of arrays in Theme 2, “Math and Statistics: Matrix Math.”
end feature

Common Usage

array(data = NA, dim = length(data), dimnames = NULL)

Related Commands

as.array
is.array
dim
dimnames
drop
/Level1

Command Parameters

data = NAA vector to be used to create the array. Other objects are coerced to form a vector before making the array.
dim = length(data)The dimensions of the array as a vector. A vector of 2 sets row and column sizes, respectively.
dimnames = NULLA list of names for each dimension of the array. The default, NULL, creates no names.

Examples

 ## Simple arrays > array(1:12) # Simple 12-item vector [1] 1 2 3 4 5 6 7 8 9 10 11 12 > array(1:12, dim = 12) # Set length explicitly [1] 1 2 3 4 5 6 7 8 9 10 11 12 > array(1:12, dim = 6) # Can set length to shorter than data [1] 1 2 3 4 5 6 > array(1:12, dim = 18) # Longer arrays recycle values to fill [1] 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 > array(1:24, dim = c(3, 4, 2)) # A 3-dimensional array , , 1 [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 2 5 8 11 [3,] 3 6 9 12 , , 2 [,1] [,2] [,3] [,4] [1,] 13 16 19 22 [2,] 14 17 20 23...

Table of contents

  1. Cover
  2. Theme 1: Data
  3. Theme 2: Math and Statistics
  4. Theme 3: Graphics
  5. Theme 4: Utilities
  6. About the Author
  7. Introduction