Re: [R] scatter plot question

2009-03-04 Thread Marc Vinyes
plot(x,rho,pch=id)

-Mensaje original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]en
nombre de Dipankar Basu
Enviado el: 03 March 2009 20:11
Para: r-help@r-project.org
Asunto: [R] scatter plot question


Hi R Users,

I have a dataframe like this:

id  x   rho
A  1   0.1
B  20  0.5
C  2   0.9
...

I want to do a scatter plot of x versus rho but for each point on the
scatter plot I want the corresponding entry for id instead of points. In
STATA I can do so by

twoway (scatter x rho, mlabel(id))

How can I do the same in R? I am sure there is some simple way to do this.

Dipankar

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

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


Re: [R] scatter plot question

2009-03-04 Thread Tim Cavileer

At 12:19 AM 3/4/2009, you wrote:

plot(x,rho,pch=id)


Or this.
Tim

 dat
  id  x rho
1  A  1 0.1
2  B 20 0.5
3  C  2 0.9

 labels-dat$id
 labels
[1] A B C
 plot(dat$x,dat$rho,pch=labels)

__
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] scatter plot question

2009-03-03 Thread Dipankar Basu
Hi R Users,

I have a dataframe like this:

id  x   rho
A  1   0.1
B  20  0.5
C  2   0.9
...

I want to do a scatter plot of x versus rho but for each point on the
scatter plot I want the corresponding entry for id instead of points. In
STATA I can do so by

twoway (scatter x rho, mlabel(id))

How can I do the same in R? I am sure there is some simple way to do this.

Dipankar

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


Re: [R] scatter plot question

2009-03-03 Thread Mark Lyman
Dipankar Basu basu.15 at gmail.com writes:

 
 Hi R Users,
 
 I have a dataframe like this:
 
 id  x   rho
 A  1   0.1
 B  20  0.5
 C  2   0.9
 ...
 
 I want to do a scatter plot of x versus rho but for each point on the
 scatter plot I want the corresponding entry for id instead of points.

test - data.frame(id=c(A, B, C), x=c(1, 20, 2), rho=c(0.1, 0.5, 0.9))
plot(rho~x, test, pch=as.character(id))

Mark Lyman

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