7.3: Accessing Data in Data Frames - Part ii
7.3: Accessing Data in Data Frames - Part iiThis is a continuation of the previous video.
Note: We should mention the very useful function subset()
which allows us to extract subsets from data frames based on multiple logical tests. For example subset(cars, hp<150 & cyl<8)
. It is worth noting that the dataframe created by subset()
will contain all factor levels of the original dataframe, even if some are not used - droplevels()
can be used to remove unused levels.