Re: [R] line plot

2007-02-01 Thread Rense Nieuwenhuis
Hi,

or otherwise you may try:

  plot(c(1,5), c(1,10),type=l)

kindest regard, Rense


On Feb 1, 2007, at 8:14 , Petr Pikal wrote:

 Hi

 see ?segments
 segments(1,10,5,10)

 HTH
 Petr


 On 1 Feb 2007 at 14:21, XinMeng wrote:

 From: XinMeng [EMAIL PROTECTED]
 To:   r-help@stat.math.ethz.ch
 Date sent:Thu, 01 Feb 2007 14:21:34 +0800
 Subject:  [R] line plot
 Send reply to:XinMeng [EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED]

 Hello sir:
 I wanna get such kind of plot: a line whose start point is(1,10),end
 point is(5,10)

 In other words:

 How can I draw a line if I only know the coordinate of the start  
 point
 and end point? Thanks! My best

 __
 R-help@stat.math.ethz.ch 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.

 Petr Pikal
 [EMAIL PROTECTED]

 __
 R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] line plot

2007-01-31 Thread XinMeng
Hello sir: 
I wanna get such kind of plot: a line whose start point is(1,10),end point 
is(5,10) 

In other words: 

How can I draw a line if I only know the coordinate of the start point and end 
point? Thanks! My best

__
R-help@stat.math.ethz.ch 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] line plot

2007-01-31 Thread Petr Pikal
Hi

see ?segments
segments(1,10,5,10)

HTH
Petr


On 1 Feb 2007 at 14:21, XinMeng wrote:

From:   XinMeng [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Date sent:  Thu, 01 Feb 2007 14:21:34 +0800
Subject:[R] line plot
Send reply to:  XinMeng [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]

 Hello sir: 
 I wanna get such kind of plot: a line whose start point is(1,10),end
 point is(5,10) 
 
 In other words: 
 
 How can I draw a line if I only know the coordinate of the start point
 and end point? Thanks! My best
 
 __
 R-help@stat.math.ethz.ch 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.

Petr Pikal
[EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] line plot through NA

2006-10-02 Thread rggefrm
Dear R-help list,

I hope I did not miss something obvious, because my question seems very 
simple, but I couln't figure out how to do it.

If I have the following data:
Day-c(1,2,3,4,5,6,7)
V-c(5,NA,10,30,45,NA,10)
than the line in plot

plot(V~Day, type=b)

will start with the 3rd value and stop stop at the 5th value because all NA 
are omitted. Is there now a parameter which can be added to the plot 
function so the line will start with with the first value and skip the NA 
values and can this than applied to xyplots.

Many thanks

__
R-help@stat.math.ethz.ch 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] line plot through NA

2006-10-02 Thread David Barron
I assume you mean that you want the first point to be connected by a
straight line to the third, etc. because fisrt and sixth points are
shown on the plot.  If so, you can use the approx function:


plot(approx(Day,V,n=length(Day)), type=l)
points(Day,V)

On 02 Oct 2006 15:31:59 +0100, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Dear R-help list,

 I hope I did not miss something obvious, because my question seems very
 simple, but I couln't figure out how to do it.

 If I have the following data:
 Day-c(1,2,3,4,5,6,7)
 V-c(5,NA,10,30,45,NA,10)
 than the line in plot

 plot(V~Day, type=b)

 will start with the 3rd value and stop stop at the 5th value because all NA
 are omitted. Is there now a parameter which can be added to the plot
 function so the line will start with with the first value and skip the NA
 values and can this than applied to xyplots.

 Many thanks

 __
 R-help@stat.math.ethz.ch 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.



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

__
R-help@stat.math.ethz.ch 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] line plot through NA

2006-10-02 Thread Peter Dalgaard
[EMAIL PROTECTED] writes:

 Dear R-help list,
 
 I hope I did not miss something obvious, because my question seems very 
 simple, but I couln't figure out how to do it.
 
 If I have the following data:
 Day-c(1,2,3,4,5,6,7)
 V-c(5,NA,10,30,45,NA,10)
 than the line in plot
 
 plot(V~Day, type=b)
 
 will start with the 3rd value and stop stop at the 5th value because all NA 
 are omitted. Is there now a parameter which can be added to the plot 
 function so the line will start with with the first value and skip the NA 
 values and can this than applied to xyplots.

AFAIK, this is not controlable via options or graphics parameters. So
the way forward would be to remove the points with missing data.
Here's one way:

plot(V~Day, type=b, data=na.omit(data.frame(V,Day)))

and another:

plot(V~Day, type=b, subset=complete.cases(V,Day))

and another (messes up axis labels, though)

s - complete.cases(V,Day)
plot(Day[s], V[s], type=b)



-- 
   O__   Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch 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] line plot through NA

2006-10-02 Thread Doran, Harold
Do you mean something like this:

 plot(approx(Day,V), type='l') 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 [EMAIL PROTECTED]
 Sent: Monday, October 02, 2006 10:32 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] line plot through NA
 
 Dear R-help list,
 
 I hope I did not miss something obvious, because my question 
 seems very simple, but I couln't figure out how to do it.
 
 If I have the following data:
 Day-c(1,2,3,4,5,6,7)
 V-c(5,NA,10,30,45,NA,10)
 than the line in plot
 
 plot(V~Day, type=b)
 
 will start with the 3rd value and stop stop at the 5th value 
 because all NA are omitted. Is there now a parameter which 
 can be added to the plot function so the line will start with 
 with the first value and skip the NA values and can this than 
 applied to xyplots.
 
 Many thanks
 
 __
 R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Line plot using xyplot function in lattice package

2005-03-17 Thread Ghosh, Sandeep
Hi All,

For the following data when I use xyplot in package lattice the intervals are 
in the order of 2, 24, 8, but instead I want them to be in the order 2, 8, 24.

  Treatment Interval  value
  A  2  0.448
  A24   1.85
  A  8  1.166
  B  2  1.074
  B24   1.5
  B  8  1.065
  C20.854
  C  8  0.589

The R script is xyplot(value ~ Interval, data=studyData, type='b', groups = 
Treatment,

Is there a way in xyplot to specify the order?. 

-Sandeep

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Line plot using xyplot function in lattice package

2005-03-17 Thread Sundar Dorai-Raj

Ghosh, Sandeep wrote on 3/17/2005 1:25 PM:
Hi All,
For the following data when I use xyplot in package lattice the intervals are 
in the order of 2, 24, 8, but instead I want them to be in the order 2, 8, 24.
  Treatment Interval  value
  A  2  0.448
  A24   1.85
  A  8  1.166
  B  2  1.074
  B24   1.5
  B  8  1.065
  C20.854
  C  8  0.589
The R script is xyplot(value ~ Interval, data=studyData, type='b', groups = 
Treatment,
Is there a way in xyplot to specify the order?. 

-Sandeep

Hi Sandeep,
You can make Interval an ordered variable:
studyData$Interval - ordered(studyData$Interval, c(2, 24, 8))
xyplot(value ~ Interval, data=studyData, type='b', groups = Treatment)
--sundar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Line plot using xyplot function in lattice package

2005-03-17 Thread Sundar Dorai-Raj

Sundar Dorai-Raj wrote on 3/17/2005 2:27 PM:

Ghosh, Sandeep wrote on 3/17/2005 1:25 PM:
Hi All,
For the following data when I use xyplot in package lattice the 
intervals are in the order of 2, 24, 8, but instead I want them to be 
in the order 2, 8, 24.

  Treatment Interval  value
  A  2  0.448
  A   241.85
  A  8  1.166
  B  2  1.074
  B   241.5
  B  8  1.065
  C 2  0.854
  C  8  0.589
The R script is xyplot(value ~ Interval, data=studyData, type='b', 
groups = Treatment,

Is there a way in xyplot to specify the order?.
-Sandeep

Hi Sandeep,
You can make Interval an ordered variable:
studyData$Interval - ordered(studyData$Interval, c(2, 24, 8))
xyplot(value ~ Interval, data=studyData, type='b', groups = Treatment)
--sundar
Sorry I misread your original message. You just need to re-order the 
data, as in:

studyData - studyData[do.call(order, studyData), ]
xyplot(value ~ Interval, data=studyData, type='b', groups = Treatment)
HTH,
--sundar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Line plot help

2003-07-16 Thread Carlos Rios
I was wondering if is there any way of plotting  line segments on a plot.

Actually I need a graph that shows the advantage of using a different method
for estimate the parameter of my databse, so I've plotted the N estimatives
for M areas in my database and then I've plotted the new estimation (N'
estimatives) and I need a line to link those paired points (N'(1)-N(1),
N'(2)-N(2)) vertically, for every area.   I made a functions that draws
points trougth the diference of N(*)'-N(*) put it consume alot of CPU and
RAM...

Better, is there any plot that does what I want to do? :)



 Thanks,
  Carlos Rios
  http://www.ence.ibge.gov.br/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Line plot help

2003-07-16 Thread Spencer Graves
Standard advice:  plot to set xlim and ylim, then a loop with a 
separate call to lines in a loop for each line desired.  Someone else 
may have something better for your current needs, but this works for me.

hope this helps.  spencer graves

Carlos Rios wrote:
I was wondering if is there any way of plotting  line segments on a plot.

Actually I need a graph that shows the advantage of using a different method
for estimate the parameter of my databse, so I've plotted the N estimatives
for M areas in my database and then I've plotted the new estimation (N'
estimatives) and I need a line to link those paired points (N'(1)-N(1),
N'(2)-N(2)) vertically, for every area.   I made a functions that draws
points trougth the diference of N(*)'-N(*) put it consume alot of CPU and
RAM...
Better, is there any plot that does what I want to do? :)



 Thanks,
  Carlos Rios
  http://www.ence.ibge.gov.br/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Line plot help

2003-07-16 Thread James MacDonald
Segments should do what you want. Try ?segments for help.

Jim



James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623

 Carlos Rios [EMAIL PROTECTED] 07/16/03 12:26PM 
I was wondering if is there any way of plotting  line segments on a
plot.

Actually I need a graph that shows the advantage of using a different
method
for estimate the parameter of my databse, so I've plotted the N
estimatives
for M areas in my database and then I've plotted the new estimation
(N'
estimatives) and I need a line to link those paired points
(N'(1)-N(1),
N'(2)-N(2)) vertically, for every area.   I made a functions that
draws
points trougth the diference of N(*)'-N(*) put it consume alot of CPU
and
RAM...

Better, is there any plot that does what I want to do? :)



 Thanks,
  Carlos Rios
  http://www.ence.ibge.gov.br/ 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help