When you call plot with more than two columns, uses the pairs() function. That means you have to write a panel function. Here are a couple of relatively simple examples:
pairs(variable[,2:4], panel=function(x, y, ...) text(x, y, variable$group)) pairs(variable[,2:4], panel=function(x, y, ...) points(x, y, pch=as.numeric(variable$group))) The first one plots the group instead of a point and the second one plots a symbol for each group. ---------------------------------------------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Bert Gunter > Sent: Friday, August 17, 2012 9:18 AM > To: cm256 > Cc: r-help@r-project.org > Subject: Re: [R] Plot multiple variables: label points > > ?text > > Have you read the "Introduction to R" tutorial. If not, do so before > further posting. If so, re-read section 12.2. > > -- Bert > > > > On Fri, Aug 17, 2012 at 6:33 AM, cm256 <d-...@gmx.at> wrote: > > Hello, I have a data.frame with 10-15 entries which looks like this: > > > > group time1 time2 time3 > > 1 F18 4394.500 21043.50 14949.00 > > 2 F25 4678.000 23727.65 15683.12 > > 3 F30 4909.775 23487.60 16724.40 > > > > I plot this with: > > plot(variable[,2:4]) > > so that a plot with 3 rows and 3 lines for time1, time2 and time3 > appears. > > > > Is it somehow possible to label the data points with the values > stored in > > group (F18, F25...)? > > > > > > > > -- > > View this message in context: http://r.789695.n4.nabble.com/Plot- > multiple-variables-label-points-tp4640611.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help@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. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb- > biostatistics/pdb-ncb-home.htm > > ______________________________________________ > R-help@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. ______________________________________________ R-help@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.