{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Data.table+introduction

Data.table+introduction - Data.table introduction October 3...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Data.table introduction October 3, 2016 1 Data manipulation with data.table package 1.0.1 data.table is an advanced version of data.frame. 1.0.2 It inherits from data.frame and works perfectly even when data.frame syntax is applied on data.table. 1.0.3 The syntax of data.table is quite similar to SQL. Therefore, if you’ve worked on SQL you would quickly understand it. The general form of syntax is: ** DT[i, j, by] ** </center> 1. DT is referred to the data table. 2. i <=> where: refers to the row indexing takes place i.e. put the row condition here. 3. j <=> select: refers to the column indexing takes place i.e. put the conditions (to filter, to summarise) on columns here. 4. by <=> group_by: refers to any categorical variable i.e. put the variable on the basis of which the grouping shall be executed. 5. If you think in SQL terminology, the i corresponds to WHERE, j to SELECT and by to GROUP BY. Example: In [ ]: #install.packages("data.table") library (data.table) #creating a dummy data table system.time (dt <- read.csv( "F08-F12_DirectAdmit.csv" )) system.time
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern