Complete the code to create a basic ggplot object with the data frame 'df'.
p <- ggplot([1])aes or geom_point() directly inside ggplot() without specifying data.ggplot itself as argument.The ggplot() function needs a data frame as its first argument to know which data to use.
Complete the code to map the variable 'x_var' to the x-axis inside aes().
p <- ggplot(df, aes(x = [1]))Inside aes(), you specify the variable names from the data frame to map to aesthetics like x or y axes.
Fix the error in the code by completing the aes() mapping for both x and y variables.
p <- ggplot(df, aes(x = [1], y = [2])) + geom_point()
geom_point inside aes().Both x and y inside aes() must be variable names from the data frame to plot points correctly.
Fill both blanks to create a scatter plot mapping 'height' to x and 'weight' to y.
p <- ggplot(data = df, aes(x = [1], y = [2])) + geom_point()
To plot height on the x-axis and weight on the y-axis, map these variable names inside aes().
Fill all three blanks to create a ggplot with data 'df', mapping 'age' to x, 'income' to y, and adding points.
p <- ggplot([1], aes(x = [2], y = [3])) + geom_point()
aes().The ggplot() function needs the data frame first, then inside aes() you map the variables for x and y axes.