EECS 1520 Summer Final Test-Questions, Answers|
Newest Update 2026/2027
What are the 3 main components involved in creating GGPLOTS?
1. Data - Identify which file to use
ex.
> ggplot( "name_of_file" )
2. Aesthetics - Identify what each of the axis will look like and the data they will use
ex.
> aes(
x = "name_data"
y = "name_data"
)
3. Geometry - Choosing a type of graph
> geom_point( "type_of_graph" )
What are the different types of geoms used in ggplots?
- Geom_point = Scatterplot
- Geom_line = Line Graph
- Geom_bar = Bar Graph
- Geom_histogram = Histogram
- Geom_Boxplot = Boxplot
, What does "data = NULL" mean in reference to GGPPLOTS?
NULL means the absence of any value, when generating a ggplot that DOES NOT use an
external data frame like an excel sheet you use "data=NULL". In these cases you assign value to
variables that are often placed within the Aes( ) field on the x and y axis respectively
What does the following code create in R:
> ggplot (data = NULL, aes( x = "variable" , y = "variable" ) + geom_point ( ) + geom_line
()
In ggplots what is the difference between a categorical variable and a numerical variable
for colour = " " ?
When variable used for colour in a ggplot is numerical (meaning it only has numbers assigned to
it) then the colour automatically recognizing the values as continuous and creates a GRADIENT
of colour. When the variable is categorical (a mix of text and numbers, or all strings) then each
value has a distinct separate colour.
How can you get around the automatic graduation of colour with numerical variables?
By utilizing Factor ( ), you are able to change a numerical variable into a categorical one as
factor changes the values of the numerical from continuous to discrete making each number its
own distinct value
How do you implement Factor ( )?
In the "Colour ="
Newest Update 2026/2027
What are the 3 main components involved in creating GGPLOTS?
1. Data - Identify which file to use
ex.
> ggplot( "name_of_file" )
2. Aesthetics - Identify what each of the axis will look like and the data they will use
ex.
> aes(
x = "name_data"
y = "name_data"
)
3. Geometry - Choosing a type of graph
> geom_point( "type_of_graph" )
What are the different types of geoms used in ggplots?
- Geom_point = Scatterplot
- Geom_line = Line Graph
- Geom_bar = Bar Graph
- Geom_histogram = Histogram
- Geom_Boxplot = Boxplot
, What does "data = NULL" mean in reference to GGPPLOTS?
NULL means the absence of any value, when generating a ggplot that DOES NOT use an
external data frame like an excel sheet you use "data=NULL". In these cases you assign value to
variables that are often placed within the Aes( ) field on the x and y axis respectively
What does the following code create in R:
> ggplot (data = NULL, aes( x = "variable" , y = "variable" ) + geom_point ( ) + geom_line
()
In ggplots what is the difference between a categorical variable and a numerical variable
for colour = " " ?
When variable used for colour in a ggplot is numerical (meaning it only has numbers assigned to
it) then the colour automatically recognizing the values as continuous and creates a GRADIENT
of colour. When the variable is categorical (a mix of text and numbers, or all strings) then each
value has a distinct separate colour.
How can you get around the automatic graduation of colour with numerical variables?
By utilizing Factor ( ), you are able to change a numerical variable into a categorical one as
factor changes the values of the numerical from continuous to discrete making each number its
own distinct value
How do you implement Factor ( )?
In the "Colour ="