> On Feb 26, 2015, at 2:02 PM, Scott Colwell <scolw...@uoguelph.ca> wrote: > > I think I have one solution. Not very pretty though. Relies on the text not > changing at all. > > as.numeric(gsub("Mean relative difference: ", "", > all.equal(cov2cor(ITEMCOV),cor(item.data))[2])) > > Is there a better way? >
`all.equal` is a generic function and it appears you are interested in `all.equal.numeric`. Not sure if it’s “better” but you could fairly easily hack the all.equal.numeric function to replace this code (near the end of the function code) : if (is.na(xy) || xy > tolerance) msg <- c(msg, paste("Mean", what, "difference:", format(xy))) ,,, with: if (is.na(xy) || xy > tolerance) msg <- xy (probably best to make it have a different name and not use 'all.equal' to name it.) When it did that I got this as a result: > all.EQ( seq(1,2, by=0.1)*10, 10:20) [1] TRUE > all.EQ( seq(1,2, by=0.11)*10, 10:20) [1] "Numeric: lengths (10, 11) differ" > all.EQ(seq(1,2, by=0.11)*10, 10:19) [1] 0.03225806 — David Winsemius, MD Alameda, CA, USA ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.