Vector not being returned

Hi friends,

In the Google Data Analytics Certificate course, the instructor defines a vector as:
vec_1 <- c(13, 48.5, 71, 101.5, 2) and when she types "vec_1" in the next line and presses enter, her vector is returned. (I wanted to attach a screenshot of her video but as I'm a new user, I can only upload one media file - as such, I've saved that for another screenshot).

However, when I do this in RStudio Cloud (which is the program the instructor uses), my vector is not returned, and I get the error "object 'vec_1' not found in my Console (refer to screenshot 2).

Thank you in advance for your help!

You need to create vec_1 in your global environment before you can return it.

vec_1
# Error: object 'vec_1' not found

vec_1 = 1:5
vec_1
# [1] 1 2 3 4 5

R is an interpreted language that can be run line-by-line, so if you haven't run the line that creates your vector you can't run the line that calls it!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.