//
archives

factor

This tag is associated with 1 post

Drop unused factor levels in a dataframe

gf <- gf[grep(“[^0-9]”, x=gf$Genre, value=FALSE), ]
gf <- droplevels(gf) # drop unused factors

 

http://stackoverflow.com/questions/1195826/dropping-factor-levels-in-a-subsetted-data-frame-in-r

For matrix, see

http://quantitative-ecology.blogspot.sg/2008/02/drop-unused-factor-levels.html

Advertisements
mathbabe

Exploring and venting about quantitative issues

The Stone and the Shell

Using large digital libraries to advance literary history

Hi. I'm Hilary Mason.

Zoom out, zoom in, zoom out.

Introduction to Data Science, Columbia University

Blog to document and reflect on Columbia Data Science Class

statMethods blog

A Quick-R Companion

the Tarzan

[R] + applied economics.

4D Pie Charts

Scientific computing, data viz and general geekery, with examples in R and MATLAB.