Basic Data Manipulation for Relational Data in R

  • Comments posted to this topic are about the item Basic Data Manipulation for Relational Data in R

  • Thanks for the good article.

  • Really impressive, actually took us to very basic rules of using R, and a way to describe is impressive

    Sheraz Mirza::hehe:

  • The article is very enlightening for me. Thanks for that.

    I have a question regarding the last code in the article. The query written only lists as output fields "Name" and "Size"

    subset(advdata, advdata$Size<45, select=Name:Size)

    However, the results show another column, named "ListPrice".

    Is there a typo in the query or R uses a different algorithm to determine the columns to be selected?

    Thanks in advance and I apologize for my bad english.

    Regards from Argentina.

    Ariel.

  • Hi Ariel, the colon : between fields indicates from-to, from this column to that column, and you will get all the fields in between. So when you say Name:Size, since ListPrice is the column between the two, it is also listed. If you want just Name and Size, you have to instead use subset(advdata, advdata$Size<45, select=c(Name,Size)) - that will give you just the two columns or more that you need. I hope this answers your question. No need to apologize on the english etc. - you communicated what you wanted to know just fine. Thank you.

  • Great. Thank you so much for having the time to let me know.

    Regards.

    Ariel.

  • Excellent article. Your writing is very clear and concise. I look forward to many more post by you. Thank you for your contributions.

    Jeff "Woody" Torres

Viewing 7 posts - 1 through 6 (of 6 total)

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