R Lectures Week1 Flashcards

1
Q

Installin a package

A

install.packages(“name of package”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

show only the top/bottom of data set

A

head(name of data)

tail(name of data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

make a series of numbers 1 - 100

A

print(1:100)

: gives you numbers in a sequences

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

find out what a function does

A

? function ( ?:) brings up info about :

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

print(“He said, “I really want to go to the movies!””)

only the he said is being read as part of the text. how to fix?

A

\ gives instructions that the “ is just a word

print(“He said, "I really want to go to the movies!"”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

print(“He said, "I really want to go to the movies!"”)

how to see in the console as how it reads as text

A

cat(“He said, "I really want to go to the movies!"”)

cat: Outputs the objects, concatenating the representations. cat performs much less conversion than print

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

ask for an input to store

show that input

A

vector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly