Re: [R] filled.contour without box

2003-09-23 Thread Roger D. Peng
If you just want to get rid of the axes, you can do filled.contour(x, plot.axes = { }) -roger Uwe Ligges wrote: Jan Kleinn wrote: Dear all, I would like to make a filled contour plot without the box R is generating by default around the plotting area, i.e. I'm looking for an option in fille

Re: [R]Bivariate Ripley K function

2003-09-17 Thread Roger D. Peng
I believe the `splancs' package from CRAN has a bivariate K function. For error bars you'll probably have to use Monte Carlo methods. `splancs' has some tools for that. -roger Karin Leiderman wrote: Hello, I have used the univariate Ripley K function in R, but does anyone know if there is a

Re: [R] Problem in installing "quantreg" package

2003-09-11 Thread Roger D. Peng
You probably do not have permission to write to that directory (and you need write permission to install a package). I assume you are on Unix? Either ask your system administrator to install it for you or install it into a directory where you have permission. For example, I make a subdirecto

Re: [R] coef names in lm

2003-09-10 Thread Roger D. Peng
Maybe this will work for you: df <- as.data.frame(design) lm.2 <- lm(response ~ ., df) -roger Jean Eid wrote: Dear all, I am interested in finding out how to change the names of coefficients in the lm function. I have a design matrix which I called "design" where each variate has its own name. H

Re: [R] png support

2003-09-07 Thread Roger D. Peng
You need the devel versions of those libraries. I think (not sure, though) that they are libpng-devel-*.rpm and zlib-devel-*.rpm where * is the version number. -roger Jose Quesada wrote: Hi all, It's me again with compiling questions :) Even though I have libpng and zlib: rpm -q libpng libp

Re: [R] boot package

2003-09-03 Thread Roger D. Peng
It's hard to say, but I sometimes get this error when I either have a very small dataset or if I don't do enough resamples (i.e. R is too small). -roger Ernesto Jardim wrote: Hi, I'm getting this error that I don't understand can someone give an hint on this ? Thanks EJ boot.ci(blm01,type

Re: [R] Creating a new table from a set of constraints

2003-08-29 Thread Roger D. Peng
I would use the subset() function. Assuming the data frame has variable names "Gender" and "Age", you could do: Y1 <- subset(X, Gender == 1 & Age >= 18 & Age <= 40) Y2 <- subset(X, Gender == 0 & Age >= 20 & Age <= 30) -roger Francisco J. Bido wrote: Hi Everyone, Here's a silly newbie question

Re: [R] how to divide a string into characters? - for comparingstrings that is

2003-07-17 Thread Roger D. Peng
David Andel wrote: Hi I am searching for a way to do something like "ABC" -> c("A","B","C"). How can this be accomplished? Try strsplit("ABC", "")[[1]] I tried cut() and split(), but they do something else, it seems. The purpose for doing this is to find the number of common (and uncommon

Re: [R] Minor nuisance with rw1071

2003-07-17 Thread Roger D. Peng
s and it is quite possible that this is the cause, but we do need to be able to reproduce the problem. On Thu, 17 Jul 2003, Roger D. Peng wrote: This doesn't happen with me. When I startup the focus is on the console. I'm running > version _ platform i3

Re: [R] Minor nuisance with rw1071

2003-07-17 Thread Roger D. Peng
This doesn't happen with me. When I startup the focus is on the console. I'm running > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor7.1 year

Re: [R] Excel can do what R can't?????

2003-07-16 Thread Roger D. Peng
I'm having a little difficulty understanding this thread. If Excel can do the job correctly and suits your needs, why not just use Excel? As far as I know, 'optim' cannot optimize a function subject to arbitrary equality constraints. The 'constrOptim' function allows for linear inequality co

Re: [R] numerical differentiation in R? (for optim "SANN" parscale)

2003-07-16 Thread Roger D. Peng
'optim' does not require any differentiation of the objective function for the "SANN" method. For the other four methods 'optim' will do numerical differentiation for you if a gradient is not provided. Furthermore, the 'parscale' argument has nothing to do with differentiation. As far as I k

Re: [R] (no subject)

2003-07-15 Thread Roger D. Peng
One way might be to use a connection and `writeLines'. For example: a <- matrix(1:8, byrow = TRUE, ncol = 4) a [,1] [,2] [,3] [,4] [1,]1234 [2,]5678 con <- file("testfile.txt", "w") writeLines("#data", con) write(a, con, ncol = 4) close(con) -roger micha

Re: [R] eigen vector sign reversal

2003-07-15 Thread Roger D. Peng
I think at version 1.7.0 R started using LAPACK for its eigen/svd routines. I think using `eigen(x, EISPACK = TRUE)' uses the previous version. -roger Karim Elsawy wrote: I've just installed R 1.7.1 under linux red hat I noticed sign reversal of eigen vectors ,some of them not all, upon using

Re: [R] problem with coding for 'optim' in R

2003-07-14 Thread Roger D. Peng
the value of 'q' that is passed to 'f', not the one stored in the global workspace. It seems your interpretation of how 'optim' works is correct, but you have to rewrite 'f' so that it actually uses the arguments passed to it. -roger Michael Rennie w

Re: [R] problem with coding for 'optim' in R

2003-07-14 Thread Roger D. Peng
It's important to remember that in R functions return whatever happens to be the last element of the function block, unless there is an explicit 'return' statement. Your function 'f' in the second example is written incorrectly and will not work in 'optim'. The last element in the function bl

Re: [R] methods help and glmmPQL

2003-07-14 Thread Roger D. Peng
I think with the introduction of namespaces in R version 1.7.0 many of the methods in packages were hidden from the user. That's why (for example) VarCorr.lme does not show up. methods(class =) only shows user-visible methods. Notice the following: methods(VarCorr) [1] "VarCorr.lme" "

Re: [R] How robust is mle in R?

2003-07-13 Thread Roger D. Peng
There's no 'mle' routine in R. For doing general maximum likelihood estimation I often use 'optim' or 'nlm'. I find 'optim' to be very useful, although you have to become familiar with all of the options/arguments in order to use it successfully. For example, you often have to provide scalin

Re: [R] error with methods on R-1.7.0

2003-07-07 Thread Roger D. Peng
Does this happen when you do R --vanilla? You might be loading an outdated package on startup which needs to be reinstalled. -roger Katalin Csillery wrote: Dear All, I just upgraded for R-1.7.0 and it starts with the error message: Error in assign("__MethodMetaData", table, envir = where) :

Re: [R] make

2003-06-27 Thread Roger D. Peng
I believe the recommended `make' command is GNU make. You may want to install/try this and see if it works. It may already be installed on your system but called `gmake'. -roger George Caunt wrote: During the installation I do my './configure' but the 'make' command does not work. I'm using

Re: [R] help on R programming.

2003-06-23 Thread Roger D. Peng
Murad Nayal wrote: Hello all, I am looking for books to help me gain a firmer grasp on the S/R programming language , programing / data structures etc. it seems that for this purpose two books are typically recommended: Programming with Data: A Guide to the S Language, John M. Chambers and Alt

Re: [R] stepwise regression

2003-06-20 Thread Roger D. Peng
Try, help.search("stepwise") It brings up the functions step() and stepAIC() from MASS. Andrew Taylor wrote: Hi, S-PLUS includes the function "stepwise" which can use a variety of methods to conduct stepwise multiple linear regression on a set of predictors. Does a similar function exist in R?

Re: [R] finding contours in a matrix

2003-06-18 Thread Roger D. Peng
You may be interested in this message (from the archives): https://www.stat.math.ethz.ch/pipermail/r-help/2003-June/033583.html -roger Douglas Beare wrote: Hi, I have matrix of sea bottom depths that I am plotting in R with the function 'image'. I am particularly interested in the 200m depth con

Re: [R] Macintosh plots

2003-06-18 Thread Roger D. Peng
What is d1? The plot function itself is generic and does not necessarily do anything. It might be that the d1 object is of a particular class and the plot method for that class changes the background, point color, etc. You could try par(bg = "transparent") but it's possible that the plot me

Re: [R] more efficient sum of matrix columns

2003-06-15 Thread Roger D. Peng
colSums()/rowSums() will be *much* faster and you can specify na.rm = TRUE. -roger Jonathan Baron wrote: On 06/14/03 20:51, Jean Eid wrote: Dear R users, I am looking for a more efficient way to compute the sum of columns of a matrix. I am currently using apply(data, 2, sum) however, I am bui

Re: [R] bootstrap question

2003-06-12 Thread Roger D. Peng
You are using the boot function incorrectly. This is taken from the help page: statistic: A function which when applied to data returns a vector containing the statistic(s) of interest. When `sim="parametric"', the first argument to `statistic' must be the data. F

Re: [R] defaults in R: packages, .Rhistory

2003-06-11 Thread Roger D. Peng
You can modify your sitewide Rprofile file (which for me is in C:\Program Files\R\rw1070\etc) and insert the line: options(defaultPackages = character()) This should start R with no additional packages. More information like this can be found in ?Startup. -roger Jacob Wegelin wrote: With th

Re: [R] small plot inside a big plot

2003-06-06 Thread Roger D. Peng
For a histogram, you might use `add = TRUE' in the call to hist(). -roger Remko Duursma wrote: Dear R-helpers, i want to draw a small plot (histogram) within a larger plot (simple scatterplot), so that the axes of the bigger plot remain intact. I know how to use layout() and par(mfrow...) and

Re: R References {was: [R] (no subject)}

2003-06-06 Thread Roger D. Peng
You might also consider S Programming, by Venables & Ripley. -roger Spencer Graves wrote: Apart from the wealth of material on "http://www.r-project.org/";, my favorite book on R is Modern Applied Statistics with S, 4th ed., by Venables and Ripley. hope this helps. spencer graves Fo

Re: [R] legends on image plots

2003-06-03 Thread Roger D. Peng
You can try using filled.contour() or maybe levelplot() in the `lattice' package. -roger Douglas Beare wrote: Hi, Does anyone out there know how to add a legend when using the R-function image? Ie. is there something out there like the S+ function image.legend? Doug. Fisheries Research Services

Re: [R] how to install a package of my own functions

2003-05-31 Thread Roger D. Peng
See the PDF manual "Writing R Extensions" from the CRAN website. -roger Huiqin Yang wrote: Hi everyone, Does anyone know how to get the functions we've made to work as a package? version _ platform sparc-sun-solaris2.9 arch sparc os sola

Re: [R] Time for Usenet R Group?

2003-05-31 Thread Roger D. Peng
Marc R. Feldesman wrote: I agree with you on the "flood" of messages lately. Often this flood accompanies a new release, but this flood has continued unabated for longer than I would have imagined. The good news is that R is becoming more popular and this (hopefully) attracts more developers,

Re: [R] Normal deviate generation - Marsaglia's ziggurat method

2003-05-31 Thread Roger D. Peng
Since it is available in the `SuppDists' package, why do we need it in the `base' package? There are perhaps hundreds of useful functions that exist in external packages that are not in `base'. My understanding was that one goal was to keep `base' from getting too bloated. -roger Ravi Varadh

Re: [R] bootstrapping data.frame and matrix

2003-05-31 Thread Roger D. Peng
The help page for `bootstrap' says that to bootstrap more complex statistics (it gives an example for the correlation), you need to bootstrap the (row) indices of the data frame and not the data frame itself. By the way, you appear to have the order of the arguments to bootstrap() incorrect bu

Re: [R] how to smooth a line in a graph

2003-05-30 Thread Roger D. Peng
You may be interested in spline(). For example: x <- 1:5 y <- c(1,3,4, 2.5,2) plot(x, y) sp <- spline(x, y, n = 50) lines(sp) -roger Rado Bonk wrote: Hi R-users, I have a line graph made by plot(). The line is very similar to hyperbola, and consists of 5 points. How can I make it look smooth? T

Re: [R] The Wrong Choice: Locked in by license restrictions

2003-05-27 Thread Roger D. Peng
My experience with Matlab users is that they perfer Matlab because of the various toolkits that are available (image processing comes to mind). With respect to standard linear algebra my guess is that Octave, Matlab, and R are comparable. A guess, though -roger Murray Jorgensen wrote: A

<    1   2   3   4