Combining Data Sets

  • Comments posted to this topic are about the item Combining Data Sets

  • Learned something new, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Good question, something new learned, thanks Steve.

    ...

  • ... except given code doesn't run when R is case sensitive.

  • This site seems to say that combining vectors with the function c (option 1) is also correct.
    Did I misinterpret it?

  • morlindk - Wednesday, January 31, 2018 5:52 AM

    ... except given code doesn't run when R is case sensitive.

    Apologies, case fixed. That's what I get for typing in answers.

  • Kaye Cahs - Wednesday, January 31, 2018 7:09 AM

    This site seems to say that combining vectors with the function c (option 1) is also correct.
    Did I misinterpret it?

    You misinterpreted the question. I want one vector with three elements. The merge() won't do that. I get a data set, not a vector.

    c() does give me a vector, but with six elements. I get:

    > c(First.Names, Last.Names)

    > [1] "Steve" "Andy" "Brian" "Jones" "Warren" "Knight"

    If I use paste(), I get three elements, combined like this:

    > paste(First.Names, Last.Names)

    >

    [1] "Steve Jones"  "Andy Warren"  "Brian Knight"

  • I guessed that would be the case.  Not very up to speed on R

  • Steve Jones - SSC Editor - Wednesday, January 31, 2018 9:56 AM

    Kaye Cahs - Wednesday, January 31, 2018 7:09 AM

    This site seems to say that combining vectors with the function c (option 1) is also correct.
    Did I misinterpret it?

    You misinterpreted the question. I want one vector with three elements. The merge() won't do that. I get a data set, not a vector.

    c() does give me a vector, but with six elements. I get:

    > c(First.Names, Last.Names)

    > [1] "Steve" "Andy" "Brian" "Jones" "Warren" "Knight"

    If I use paste(), I get three elements, combined like this:

    > paste(First.Names, Last.Names)

    >

    [1] "Steve Jones"  "Andy Warren"  "Brian Knight"

    Thanks for pointing out my error, Steve.  
    I promise to read the questions more carefully in the future.  Well, at least I promise to try to read the questions more carefully.  :satisfied:

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply