-8

I've been given a dataframe with the following structure

Data Frame:

Data Frame

There are three different types of detector: diamond, efd, pfd There are 12 different collimator measurements from 5 - 40 The pages represent the days of the experiment (there are 16 in total)

I want to produce a plot that looks something like this

Desired plot:

Desired plot

I want to colour code each vertical series of points by the three detector types.

How do I do this?

Termininja
  • 6,620
  • 12
  • 48
  • 49
E1993
  • 1
  • 3
  • What have you already tried? Where did you get stuck? Please supply a minimal reproducible example to go along with your question. Something we can work from and use to show you how it might be possible to answer your question. You can have a look at [this SO post](http://stackoverflow.com/help/mcve) on how to make a great reproducible example in R. As a minimum you could share your data with `dput()` – Eric Fail Jan 16 '16 at 15:16
  • dotchart(Collimator, Page, col=c(1,2,3)[as.numeric(Detector)]) – E1993 Jan 16 '16 at 15:16
  • I added that line above but it puts each days reading on a different lines instead of grouping them – E1993 Jan 16 '16 at 15:17
  • 5
    Never post your data as an image, please learn how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610) – Jaap Jan 16 '16 at 15:17
  • what have your tried – mtoto Jan 16 '16 at 15:33
  • 3
    This smells like homework. At the "SCHOOL OF MATHEMA..." – Mike Wise Jan 16 '16 at 15:41

1 Answers1

0

As stated above please provide a reproducible example next time. This should be what you are looking for:

> df <- data.frame(1:10, c("a", "b", "c", "b", "a", "b", "c", "b", "a", "b"))
> colnames(df) <- c("Collimator", "Page")
> df
   Collimator Page
1       1      a
2       2      b
3       3      c
4       4      b
5       5      a
6       6      b
7       7      c
8       8      b
9       9      a
10     10      b
> library(lattice)
> dotplot(Collimator ~ Page, data=df)
David Arenburg
  • 91,361
  • 17
  • 137
  • 196
tomtom
  • 259
  • 1
  • 2
  • 6