Lanmguage R Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define ‘Comment’ and how do you code it.

A

Text written in a program but not run by the computer (#)

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

Why would anyone want the computer to ignore a part of their file? Three reasons

A

-Provide context for why something is written the way it is.
-Help other people reading the code understand it faster
-Ignore a line of code and see how a program will run without it

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

What are the 5 different types of Data?

A
  1. Numeric.
  2. Character
  3. Logical
  4. Vectors
  5. NA
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Define numeric data

A

Any number with or without a decimal point: 23, 0.03 and the numeric null value NA.

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

Define character data and how is it shown, and how is it also known as.

A

Any grouping of characters on your keyboard (letters, numbers, spaces, symbols, etc.) or text. Most strings are surrounded by single quotes: ‘ … ‘ or double quotes “ … “, though we prefer single quotes. Sometimes you will hear this type referred to as “string.”

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

Define logical data.

A

This data type only has two possible values— either TRUE or FALSE (without quotes). It’s helpful to think of logical types or booleans as on and off switches or as the answers to a “yes” or “no” question.

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

Define vectors

A

A list of related data that is all the same type.

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

Define NA data

A

This data type represents the absence of a value, and is represented by the keyword NA (without quotes) but it has its own significance in the context of the different types.

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

The three NA data types

A

There is a numeric NA, a character NA, and a logical NA.

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

In order to print a value, you must put the value inside the following syntax:

A

print()

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