A subset of the vector

  • Comments posted to this topic are about the item A subset of the vector

  • Got it wrong but thanks for the question, time to reread the explanation I think. Thanks Steve.

    ...

  • If you're wondering how to subset without using a range:

    Exclamation[c(1,2)]

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  •  I got the answer wrong because I assumed that i)Exclamation[(1,2)] and ii)Exclamation[(1:2)] were equivalent.  How does the subset of consecutive values returned by position in by i differ from the range returned by ii?


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Neil Burton - Wednesday, July 12, 2017 1:01 AM

     I got the answer wrong because I assumed that i)Exclamation[(1,2)] and ii)Exclamation[(1:2)] were equivalent.  How does the subset of consecutive values returned by position in by i differ from the range returned by ii?

    See my previous reply: you need to supply a vector with the indexes. (yes, a vector in a vector 🙂

    Exclamation[1,2] would only work if it was a matrix. It would select row 1 and column 2.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Thanks for the instructive question.
    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • This has nothing to do with the question, I ran across this joke and wanted to share it.  I am sure some of you have seen it before:

    An SQL statement walks into a bar and sees two tables.  It approaches, and asks, “May I join you?”

  • bkubicek - Wednesday, July 12, 2017 8:57 AM

    This has nothing to do with the question, I ran across this joke and wanted to share it.  I am sure some of you have seen it before:

    An SQL statement walks into a bar and sees two tables.  It approaches, and asks, “May I join you?â€

    I love that joke so much I added it my signature!

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Really instructive, thanks Steve

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

  • Thanks, Steve.  If you keep posting questions like this, I just might learn R! 😉

  • Ed Wagner - Friday, July 14, 2017 7:41 PM

    Thanks, Steve.  If you keep posting questions like this, I just might learn R! 😉

    Me too!

Viewing 11 posts - 1 through 10 (of 10 total)

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