Can anyone think of a way to create a pretty() sequence that excludes zero? Or a way to remove the zero from a sequence after using pretty()? Thanks, - Jason Jason Horn Boston University Department of Biology 5 Cumington Street Boston, MA 02215 jhorn@bu.edu office: 617 353 6987 cell: 401 588 2766 [[alternative HTML version deleted]]
Jason Horn <jason at 109valentine.com> writes:> Can anyone think of a way to create a pretty() sequence that excludes > zero? Or a way to remove the zero from a sequence after using pretty()?The former is rather hard because zero is generally considered just about the prettiest number around... As for the latter, something like s <- pretty(x); s <- s[s!=0] or maybe s[zapsmall(s) != 0].> Thanks, > > - Jason > > > Jason Horn > Boston University Department of Biology > 5 Cumington Street Boston, MA 02215 > > jhorn at bu.edu > office: 617 353 6987 > cell: 401 588 2766 > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 >-- 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 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Jason Horn <jason at 109valentine.com> wrote:> Can anyone think of a way to create a pretty() sequence that excludes> zero?You could use except(pretty(x), 0), if you first defined the (quite useful) set-operation function: R> except <- function(a,b) unique(a[!match(a, b, 0)]) (Consider this a plug to add "except" to the "union", "intersect", etc., family of set operations.) -- David Brahm (brahm at alum.mit.edu)