[R] scatterplot matrix question

William Simpson william.a.simpson at gmail.com
Sat Jan 2 18:16:26 CET 2010


On Sat, Jan 2, 2010 at 4:55 PM, Charles C. Berry <cberry at tajo.ucsd.edu> wrote:
> On Sat, 2 Jan 2010, William Simpson wrote:
>
>> I would like a scatterplot matrix and a correlation matrix for the
>> following set-up.
>> The data (dataframe d) are like this:
>>
>> angle  resp
>> -90      182
>> -60      137
>> -30      ...etc
>> 0
>> 30
>> 60
>> 90
>> ...etc
>>
>> I would like each cell in the matrix to be the scatterplot of the
>> responses for each pair of angles ( -90 vs -60, -90 vs -30, etc). Same
>> for the correlation matrix.
>>
>> Please tell me what to do. Thanks very much!
>
> 1) You need to "provide commented, minimal, self-contained, reproducible
>   code."
d<-read.table("rstuff/data.dat",header=TRUE)

Now what? :-)

certainly it's not
pairs(d)


> 2) You need to fill in some missing info: Either you have only one
>   response for each angle, or you need a third variable to pair up the
>   corresponding responses for one angle with those of another.
contents of rstuff/data.dat:

 angle  resp  ID
 -90      182  1
 -60      137  1
 -30      123  1
 0    67  1
 30   32  1
 60   12  1
 90    13  1
-90      178  2
 -60      111  2
 -30      137  2
 0    94  2
 30   59  2
 60   1  2
 90    19  2

I actually have a lot more than 2 experimental units (ID)...

Thanks for any help
Bill



More information about the R-help mailing list