> M
  [,1] [,2] [,3] [,4]
x 1.75 2.25 3.25 3.75
y 6.25 6.75 7.25 7.75

plot(t(M))

Does just fine for me oO

then again, as you write it, you actually have a data frame there.. so..

> D
   AAB  BAB  CCD  DCD
x 1.75 2.25 3.25 3.75
y 6.25 6.75 7.25 7.75

plot(t(D))

Does just fine for me as well oO

Also, plot clearly tells me it has no data parameter, so why are you even 
trying that?
Also, why use xbar and ybar? your rows are named x and y..
Also, $ operator usually refers to columns, not rows. You could use something 
like D["x",] instead.

plot(D["x",],D["y",])

Seemingly does not work though, probably since it calls plot.data.frame on 
finding the first data frame.

but 

plot.default(D["x",],D["y",])

works again.

Am 26.04.2012 um 07:31 schrieb Hans Thompson:

> Thanks Rui and Jeff,
> 
> I thought that transposing the matrix would let me plot it the way I thought
> it would but it did not.  How can I take:
> 
> matrix "e":
> 
>      AAB  BAB  CCD  DCD
> x  1.75  2.25  3.25  3.75
> y   6.25  6.75  7.25  7.75
> 
> and treat the x and y rows as the x and y axis values and plot these four
> points?  I'm having trouble with all matrices and plotting them.  I am using 
> 
>> plot (xbar, ybar, data = e)
> 
> and 
> 
>> plot(e$xbar, e$ybar)
> 
> trying it as a data.frame also.
> My end goal though is to use lm for all four of these points against another
> point already established and look at their relative coefficients.  
> 
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Basic-matrix-manipulation-problem-tp4584734p4588928.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.


        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to