[R] Plot only a subset of all factors in dataframe

From: Laura Hollink <laurah_at_cs.vu.nl>
Date: Fri, 04 Jan 2008 17:11:41 +0000


Hi all,
I have a dataframe called 'table' in which both factors and numerical values are stored.

> dim(table)

[1] 990 6

The fist 10 lines of table, to get an idea:

> table[1:10,]

   QueryNo Query type Ret Prec Rec

1        1   Sports exact   1    1 0.01
2        5   Office exact   0  NaN 0.00
3        6  Meeting exact   0  NaN 0.00
4        7   Studio exact   0  NaN 0.00
5        9 Building exact   0  NaN 0.00
6       10   Desert exact   1    1 0.01
7       12 Mountain exact   0  NaN 0.00
8       13     Road exact   0  NaN 0.00
9       14      Sky exact   0  NaN 0.00
10      15     Snow exact   0  NaN 0.00

I want to plot column 5 (numerical values) against column 3 (factors).

plot(table[,c(3,5)]) works fine.

However, I don't want to include all 30 levels of the factor in the plot. I would like a plot of just 5 factors: "exact", "broader1", "narrower4", etc.

Could anyone tell me how to do this, or where to find information about this?

Thanks!
Laura



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 04 Jan 2008 - 16:25:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Jan 2008 - 18:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive