Skip to content
Prev 312366 / 398506 Next

Deleting certain observations (and their imprint?)

Hi Kirk,

It's because tension is a factor with three levels, as you could see with
str(warpbreaks).

Factors are one of the mysteries of R that distinguish a novice from
an initiate.

Reading ?subset directs you to ?droplevels. Here's an example:
breaks      wool   tension
 Min.   :10.00   A:27   L:18
 1st Qu.:18.25   B:27   M:18
 Median :26.00          H:18
 Mean   :28.15
 3rd Qu.:34.00
 Max.   :70.00
'data.frame':    54 obs. of  3 variables:
 $ breaks : num  26 30 54 25 70 52 51 26 67 18 ...
 $ wool   : Factor w/ 2 levels "A","B": 1 1 1 1 1 1 1 1 1 1 ...
 $ tension: Factor w/ 3 levels "L","M","H": 1 1 1 1 1 1 1 1 1 2 ...
breaks      wool  tension
 Min.   :14.00   A:9   L:18
 1st Qu.:26.00   B:9   M: 0
 Median :29.50         H: 0
 Mean   :36.39
 3rd Qu.:49.25
 Max.   :70.00
breaks      wool  tension
 Min.   :14.00   A:9   L:18
 1st Qu.:26.00   B:9
 Median :29.50
 Mean   :36.39
 3rd Qu.:49.25
 Max.   :70.00
Sarah
On Thu, Nov 29, 2012 at 11:32 AM, Stodola, Kirk <kstodola at illinois.edu> wrote:
--
Sarah Goslee
http://www.functionaldiversity.org