LoslegenKostenlos loslegen

Creating tables with big.matrix objects

A final advantage to using big.matrix is that if you know how to use R's matrices, then you know how to use a big.matrix. You can subset columns and rows just as you would a regular matrix, using a numeric or character vector and the object returned is an R matrix. Likewise, assignments are the same as with R matrices and after those assignments are made they are stored on disk and can be used in the current and future R sessions.

One thing to remember is that $ is not valid for getting a column of either a matrix or a big.matrix.

Diese Übung ist Teil des Kurses

Scalable Data Processing in R

Kurs anzeigen

Anleitung zur Übung

  • Create a new variable mort by attaching the "mortgage-sample.desc" file.
  • Look at the first 3 rows of mort.
  • Create a table of the number of mortgages for each year in the data set. The column name in the data set is "year".

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create mort
mort <- ___

# Look at the first 3 rows
mort[___, ]

# Create a table of the number of mortgages for each year in the data set
table(___)
Code bearbeiten und ausführen