Unit 1: Introduction to R Software

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:17 AM on 6/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

24 Terms

1
New cards

What is the R code for the seven basic mathematical operators?

Addition +

Subtraction -

Multiplication *

Division /

Exponentiation ^

Square Root function sqrt(x)

Logarithmic function log(x)

2
New cards

What is a variable in R?

A variable allows the storing of a value or object as any data type

Variables are assigned using the <- assignment operator

3
New cards

What are the 5 common data types used in R?

Numeric - numbers or contain decimals

Integer - numeric data without decimals

Character - Text strings

Factor - Categorical data with limited levels

Logical - Boolean values, TRUE or FALSE

4
New cards

What comparison and logical operators are used in R?
less than

greater than

less than or equal to

greater than or equal to

equal to

not equal to

AND

OR

< > <= >= == != & |

5
New cards

What R function gives the first 6 rows of the data frame?

head()

6
New cards

What R function gives the last 6 rows of the data frame?

tail()

7
New cards

What R function gives an overview of a data frames structure?

str()

8
New cards

What R function gives the column names of a data frame?

names()

9
New cards

What R function gives the five number summary of the data fram?

summary()

10
New cards

What R function gives the dimension of the data frame?

dim()

11
New cards

What R function specifies a start value, end value of step size?

seq()

12
New cards

What R function creates sequences with repeating patternns?

rep()

13
New cards

What R function combines elements into data structures?

c()

14
New cards

What R function determines a data type?

class()

15
New cards

What R function converts data to a different data type?

as.new_data_type()

16
New cards

What R function determines the categories within a factor variable?

levels()

17
New cards

What does the colon operator : do?

Creates simple integer sequences with an increment of one

18
New cards

What do the following R functions do?

  • sqrt()

  • log()

  • abs()

  • mean()

  • sd()

  • median()

  • sqrt() - computes the square root

  • log() - computes natural logarithms

  • abs() - computes absolute value

  • mean() - gives arithmetic mean

  • sd() - computes standard deviation

  • median() - computes the sample median

19
New cards

What R function allows a data set to be viewed in a spreadsheet style?

View()

20
New cards

What functions are useful when working with packages?

install.packages("package name")

require("package name")

library("package name")

21
New cards

What is a conditional statement and how is it set out in R?

The if statement is used for execution of code only when the specified condition is TRUE

An else statement can be used in conjunction with the if statement to provide alternative code to execute when the condition is FALSE

<p>The <code>if</code> statement is used for execution of code only when the specified condition is TRUE</p><p>An <code>else</code> statement can be used in conjunction with the <code>if</code> statement to provide alternative code to execute when the condition is FALSE</p>
22
New cards

What types of loops are useful in R?

Loops are used in R to repeatedly execute a block of code

  • The for loop is used to repeat a block of code for each element in a sequence

  • With the while loop, a block of code is repeatedly executed as long as a specified condition remains TRUE

  • The repeat loop executes a block of code until a break statement is encountered within the loop

23
New cards

What do the following R functions do?

  • plot()

  • hist()

  • barplot()

  • plot() -

  • hist() - computes a histogram of given data

  • barplot() - creates a bar plot with vertical/ horizontal bars

24
New cards

What R function shows every column in a data frame and shows as much data as possible?

glimpse()