[R] [Summary] Color names
Thanks to those who took time to respond. Based on the functions that were pointed out to me I have the following: # colors.hex and colors.name convert color names to hex and visa versa # note that each color has a unique hex code but each hex code may have # more than one color colors.hex - function( x=colors() ) { color.hex - function(x) do.call( rgb, as.list(col2rgb(x)/255) ) sapply( x, color.hex ) } colors.name - function( x ) { color.name - function( x ) colors()[ colors.hex() == x ] lapply( x, color.name ) } # For example, colors.hex( red ) colors.hex( colors()[1:5] ) colors.name( #FF ) colors.name( rainbow(3) ) colors.name( rainbow(7) ) # note: only first element has a name # LL partitions all color names into equivalence classes w same hex code # LL2 is similar but only has equivalence classes with more than one name LL - by( colors(), colors.hex(), as.vector ) LL2 - LL[ lapply( LL, length ) 1 ] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Returning contour co-ordinates
Hi John Field wrote: Dear R-helpers, I'd like to be able to post-process contours coming from contour(). Does anyone have a version of contour() (or something similar) which will return the contour coordinates? In searching the archives I've come across a message in Nov 01 which had this on a wish-list, but I can find no later reference. There is a partial implementation of this available via a tiny R package (http://www.stat.auckland.ac.nz/~paul/R/clines_1.0.tar.gz) I have a Windows binary of this package for R 1.7.0 if you require it. This will become available via a call to contour() in the future. Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] ./configure needs /sw/lib?
Hello, I am using R on Mac OS X. I have tried to install the package netCDF, but have run into a problem. The install.packages command fails during a call to the configure shell script in the package build directory, because it cannot find the netCDF libraries on my system. Those libraries are installed in /sw/lib, as they were installed with fink, and this system puts everything in /sw. Either I need a way to give configure flags to install.packages(), or this package is broken. Note that /sw/lib/R/etc/Makeconf has all the right build flags. Is there a mechanism for handling problems of this nature? Many thanks. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Fitting inter-arrival time data
I have a collection of data which includes inter-arrival times of requests to a server. What I've done so far with it is use sm.density to explore the distribution, which found two large peaks. However, the peaks are made up of Gaussians, and that's not really correct, because the inter-arrival time can never be less than zero. In fact, the leftmost peak is centered at somewhere around ten seconds, and quite a bit of it extends into negative territory. What I'd like to do is fit this dataset to a mixture (sum) of exponentials, hyper-exponentials and hypo-exponentials. My preference is to use the well-known branching Erlang approximation (exponential stages) to the hyper- and hypo-exponentials. In this approximation, a distribution is specified by its mean and coefficient of variation. So far, what I've been able to come up with in a literature search has been something called the Expectation Maximization algorithm. And I haven't been able to locate R code for this. So my questions are: 1. Is EM the right way to go about this, or is there something better? 2. Is there some EM code in R that I could experiment with, or do I need to write my own? 3. Is there a way this could be done using the existing R kernel density estimators and some kind of kernel that is zero for negative values of its argument? -- M. Edward (Ed) Borasky mailto:[EMAIL PROTECTED] http://www.borasky-research.net Suppose that tonight, while you sleep, a miracle happens - you wake up tomorrow with what you have longed for! How will you discover that a miracle happened? How will your loved ones? What will be different? What will you notice? What do you need to explode into tomorrow with grace, power, love, passion and confidence? -- L. Michael Hall, PhD __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help