Step 1 issue - The data_size variable does not have the correct string but seems to work in RStudio

Screen Link: https://app.dataquest.io/m/494/control-flow-in-r/3/the-if-statement

My Code:

data_size <- nrow(recent_grads)
if(data_size > 1000) {
print(“Large”)
} else {
print(“Small”)

What I expected to happen:

data_size <- nrow(recent_grads)
print(data_size)
[1] 173
if(data_size > 1000) {

  • print(“Large”)
  • } else {
  • print(“Small”)
  • }
    [1] “Small”

What actually happened:

Parsed with column specification:
cols(
Rank = col_double(),
Major_code = col_double(),
Major = col_character(),
Total = col_double(),
Men = col_double(),
Women = col_double(),
Major_category = col_character(),
Sample_size = col_double(),
Employed = col_double(),
Full_time = col_double(),
Part_time = col_double(),
Full_time_year_round = col_double(),
Unemployed = col_double(),
Unemployment_rate = col_double(),
Median = col_double(),
College_jobs = col_double(),
Non_college_jobs = col_double(),
Low_wage_jobs = col_double()
)

Variables
data_size
recent_grads
Running your code caused an error.
The data_size variable does not have the correct string.
less…

  • This seems to work alright in RStudio, i have pasted its console output in the “what I expected to happen” section. Please let me know if this is an error or something I misunderstood from the lesson. Thank you!