[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-teaching
Subject:    Re: [R-sig-teaching] graphing inequalities (intervals) in one varible
From:       Michael Weylandt <michael.weylandt () gmail ! com>
Date:       2013-05-09 13:07:23
Message-ID: 6F016BEC-C204-4462-8988-0253CBC7D661 () gmail ! com
[Download RAW message or body]

You could perhaps say what you tried....

Michael

On May 9, 2013, at 12:33, Yahoo! <aboueiss@yahoo.com> wrote:

> 
> Dear Michael:
> 
> Thank you very much.
> 
> I am still not able to make it works.
> 
> 
> thanks
> abou
> 
> ========================
> AbouEl-Makarim Aboueissa
> Sozan Elsalakawy
> Mohamed Agamia
> 
> 246 Auburn Street, #158
> Portland, ME 04103
> USA
> 
> Tel: (207) 797-2724
> Email: aboueiss@yahoo.com
> 
> --- On Thu, 5/9/13, R. Michael Weylandt <michael.weylandt@gmail.com> wrote:
> 
> From: R. Michael Weylandt <michael.weylandt@gmail.com>
> Subject: Re: [R-sig-teaching] graphing inequalities (intervals) in one varible
> To: "Yahoo!" <aboueiss@yahoo.com>
> Cc: "R-sig-teaching" <r-sig-teaching@r-project.org>
> Date: Thursday, May 9, 2013, 6:49 AM
> 
> Here's the start of a function. I'll leave it to you to do it better
> (it should probably also use S4 methods, but that's another project):
> 
> interval <- function(lower = -Inf, upper = Inf, lower_closed = FALSE,
> upper_closed = FALSE){
> structure(.Data = NULL, lower = lower, upper = upper, lower_closed =
> lower_closed, upper_closed = upper_closed, class = 'interval')
> }
> 
> plot.interval <- function(x){
> l <- attr(x, "lower")
> u <- attr(x, "upper")
> 
> r <- c(l, u) * c(if(l > 0) 0.7 else 1.2, if(u > 0) 1.2 else 0.7)
> plot(r, c(0,1), main = '', bty = 'n', xlab = '', ylab = '', yaxt =
> 'n', type = 'n', xaxt = 'n')
> 
> axis(1, at = seq(r[1], r[2], length.out = 10))
> 
> lines(c(l, u), c(0.5, 0.5), col = 2, lwd = 2)
> 
> lc <- attr(x, 'lower_closed')
> uc <- attr(x, 'upper_closed')
> 
> 
> points(c(l, u), c(0.5, 0.5), pch = c(1, 19)[c(lc, uc) + 1], col = 2, cex = 2)
> 
> }
> 
> On Wed, May 8, 2013 at 12:10 PM, Yahoo! <aboueiss@yahoo.com> wrote:
> > Dear All:
> > 
> > It seems a very silly question. But I never tried it before. I am teaching a \
> > college algebra class this summer. 
> > I need some help with graphing intervals on the real line. For examples:
> > 
> > {x | -7<= x < 5 and x > 7}
> > 
> > {x | x > 3}
> > 
> > etc...
> > 
> > 
> > thank you very much
> > abou
> > 
> > ========================
> > 
> > AbouEl-Makarim Aboueissa
> > 
> > Sozan Elsalakawy
> > 
> > Mohamed Agamia
> > 
> > 
> > 
> > 246 Auburn Street, #158
> > 
> > Portland, ME 04103
> > 
> > USA
> > 
> > 
> > 
> > Tel: (207) 797-2724
> > 
> > Email: aboueiss@yahoo.com
> > [[alternative HTML version deleted]]
> > 
> > _______________________________________________
> > R-sig-teaching@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-teaching

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-teaching@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic