#'two-fer exercise in R '

8 messages Β· Page 1 of 1 (latest)

sand herald
#

i found first exercise is hard
I write "one for you,one for me. " in brackts it is giving error
Test passed πŸ₯‡
── Failure: A name given ───────────────────────────────────────────────────────
two_fer("Alice") not equal to "One for Alice, one for me.".
1/1 mismatches
x[1]: "One for you, one for me."
y[1]: "One for Alice, one for me."

Error: Test failed
Execution halted

fringe fractal
#
  1. Looking at the CODE RUN section, do you understand what this test is doing?
  2. Looking at the CODE RUN section, do you understand what this test is expecting and why?
  3. Looking at the TEST FAILURE section, do you understand what your code returns and how it differs?
  4. Looking at your code, do you understand why your code is returning what it returns?
sand herald
#

Yes I understand the question they are expecting the code should say something like one for you,one for me . or one for Alice, one for me . but i am totally a beginner i know basics but i feel this is hard .

plain star
#

It can be helpful if you show your code. You showed the failure, but showing your code is going to let us know exactly what you have done.

#

This will help, since when you say that you understand it "should say something like one for you,one for me" it definitely should say something like that, but not exactly like that... and the tests will fail if it is not precise. Seeing your code we can see that it is probably "something like that", but also exactly what it is.

sand herald
#

two_fer <- function(input)
{
two_fer =c("One for you, one for me.","One for Alice, one for me.")
}

fringe fractal
#

Do you understand functions and inputs?

sand herald
#

i think i should read the basics again .