Re: [R] Idiom for column operations?

2004-10-27 Thread Prof Brian Ripley
On Tue, 26 Oct 2004, Rob Steele wrote: Is there a better way to express operations between matrices and column vectors than transposing the matrix twice? This is the kind of thing I'm talking about: m = matrix(1:20, 3, 4) Ouch: that gives a warning as 20 3*4. v = colSums(m) t(t(m)

Re: [R] Error in lazyLoadDBfetch

2004-10-27 Thread Prof Brian Ripley
On Tue, 26 Oct 2004, Martin Keller-Ressel wrote: Hello, what does the following error mean?? It occured during or at the end of a lengthy (and memory-intensive) calculation using a routine from a shared library called via the '.C' function: Error in lazyLoadDBfetch(key, datafile,

Re: [R] box() and hist()

2004-10-27 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: Hi, does anybody know why the following is not working: hist(rnorm(200)) box(bty=o) gives me a box without rounded corners. Because that isn't what it is supposed to do. Did you expect 7 to give you a slanting right edge? And which letter should

Re: [R] persp(), scatterplot3d(), ... argument

2004-10-27 Thread Uwe Ligges
Robin Hankin wrote: Hello list. I very often need 3d scatterplots, and use scatterplot3D quite a lot. I am trying to modify persp() to plot scatterplots, and make use of the theta and phi arguments that persp() offers. I am having some difficulty passing the correct arguments to persp(). Here is

Re: [R] integration problem

2004-10-27 Thread Petr Pikal
Hi Christoph I use this function to calculate an area under curve. It integrates along the whole wavelength set or you can restrict the calculation by setting dm and hm to some appropriate values. It also gives you two values. The first is total area to the x axis (y=0) and the second is

[R] regexp,grep: capturing more than one substring

2004-10-27 Thread Marc Mamin
Hello, I would like to have a function that retrieve matching strings in the same way as with java.util.regex (java 1.4.2). Example: f('^.*(xx?)\\.([0-9]*)$','abcxx.785') = c('xx','785') First of all: Is it possible to achiev this with grep(... perl=TRUE,value=TRUE )? As I would call this

Re: [R] integration problem

2004-10-27 Thread Martin Maechler
Sundar == Sundar Dorai-Raj [EMAIL PROTECTED] on Tue, 26 Oct 2004 11:19:36 -0500 writes: Sundar Christoph Scherber wrote: Dear R users, I have spectral data (say, wavelength vs. extinction coefficient) for which I´d like to calculate an integral (i.e. the area

Re: [R] persp(), scatterplot3d(), ... argument

2004-10-27 Thread Uwe Ligges
Jari Oksanen wrote: On Wed, 2004-10-27 at 10:04, Uwe Ligges wrote: Robin Hankin wrote: Hello list. I very often need 3d scatterplots, and use scatterplot3D quite a lot. I am trying to modify persp() to plot scatterplots, and make use of the theta and phi arguments that persp() offers. I am

[R] Skewness and Kurtosis

2004-10-27 Thread Vito Ricci
Hi, in which R-package I could find skewness and kurtosis measures for a distribution? I built some functions: gamma1-function(x) { m=mean(x) n=length(x) s=sqrt(var(x)) m3=sum((x-m)^3)/n g1=m3/(s^3) return(g1) } skewness-function(x) { m=mean(x) me=median(x) s=sqrt(var(x)) sk=(m-me)/s

[R] predicting x values in a polynomial regression

2004-10-27 Thread Sebastian Leuzinger
Dear R I would like to predict x-values in a 4th order polynomial regression: x - c(1:10) y - c(2,7,19,49,89,94,97,98,92,89) # these are percentages lm(y ~ x+I(x^2)+I(x^3)+I(x^4)-1) - lm1 now I would like to know what the model fit (x-value) for y=50 is. This results in solving a 4th order

[R] ploting an ellipse keeps giving errors

2004-10-27 Thread Sun
library (ellipse) shape1 = c (1, 0, 0,1) dim(shape1) = c(2,2) ellipse (center = c(0,0), shape = shape1, radius = 1) = Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) : plot.new has not been called yet It is really frustrating.

Re: [R] persp(), scatterplot3d(), ... argument

2004-10-27 Thread Jari Oksanen
On Wed, 2004-10-27 at 11:11, Uwe Ligges wrote: Jari Oksanen wrote: On Wed, 2004-10-27 at 10:04, Uwe Ligges wrote: This is a larger problem if 1. one of the underlying functions does not have ... 2. you want to relay arguments to two or more underlying functions, and 3. you

Re: [R] Skewness and Kurtosis

2004-10-27 Thread Uwe Ligges
Vito Ricci wrote: Hi, in which R-package I could find skewness and kurtosis measures for a distribution? Both funcions are in package e1071. Uwe Ligges I built some functions: gamma1-function(x) { m=mean(x) n=length(x) s=sqrt(var(x)) m3=sum((x-m)^3)/n g1=m3/(s^3) return(g1) } skewness-function(x)

Re: [R] predicting x values in a polynomial regression

2004-10-27 Thread Uwe Ligges
Sebastian Leuzinger wrote: Dear R I would like to predict x-values in a 4th order polynomial regression: x - c(1:10) y - c(2,7,19,49,89,94,97,98,92,89) # these are percentages lm(y ~ x+I(x^2)+I(x^3)+I(x^4)-1) - lm1 now I would like to know what the model fit (x-value) for y=50 is. This results in

Re: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Jari Oksanen
On Wed, 2004-10-27 at 11:34, Sun wrote: library (ellipse) shape1 = c (1, 0, 0,1) dim(shape1) = c(2,2) ellipse (center = c(0,0), shape = shape1, radius = 1) = Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) : plot.new has not

Re: [R] predicting x values in a polynomial regression

2004-10-27 Thread Prof Brian Ripley
On Wed, 27 Oct 2004, Sebastian Leuzinger wrote: I would like to predict x-values in a 4th order polynomial regression: x - c(1:10) y - c(2,7,19,49,89,94,97,98,92,89) # these are percentages lm(y ~ x+I(x^2)+I(x^3)+I(x^4)-1) - lm1 now I would like to know what the model fit (x-value) for

Re: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Petr Pikal
Hi Did you read what ellipse does and how it shall be used? And what about your system, R and ellipse version? From your example i got ellipse (center = c(0,0), shape = shape1, radius = 1) Error in ellipse.default(center = c(0, 0), shape = shape1, radius = 1) : Argument x is

[R] Install Package(RODBC) warning , why?

2004-10-27 Thread Ivy_Li
Hi everybody, Could I consult one problem? I want to access database with RODBC, first download this package from http://www.microsoft.com/data/odbc as part of MDAC, the version is the newest version 2.7.0. But after I have installed this Package(RODBC) and run command

Re: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Sun
Thanks a lot. I added that line. library(ellipse) plot(-2:2, type='n') shape1 = c (1, 0, 0,1) dim(shape1) = c(2,2) center1 = c(0,0) radius1 = 1 ellipse (center1, shape1, radius1) But now it said: Error in ellipse(center, shape, radius) : dim- : dims [product 4] do not match the length of object

Re: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Sun
Thank you. I found there are two ellipses 1. R2.0 library (car) 2. R1.9 and R2.0 library (ellipse) And they are different! I can't run 1. But the 2. is kind of specialized for t-distribution confidence and so on. I need to find a general ellipse for an ellipse equation like (x-x0)^2/a +

Re: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Jari Oksanen
On Wed, 2004-10-27 at 12:04, Jari Oksanen wrote: On Wed, 2004-10-27 at 11:34, Sun wrote: library (ellipse) Here's your problem! See below. shape1 = c (1, 0, 0,1) dim(shape1) = c(2,2) ellipse (center = c(0,0), shape = shape1, radius = 1) = Error in

RE: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Charles Annis, P.E.
I apologize to the original contributor whom I have forgotten, but here is a function that does what you wish. It is not mine and was contributed some time ago. I saved it because it is so useful. ## ellipse.fn - function(loc, cov, confidence = 0.95) { A - cov

Re: [R] Install Package(RODBC) warning , why?

2004-10-27 Thread Uwe Ligges
Ivy_Li wrote: Hi everybody, Could I consult one problem? I want to access database with RODBC, first download this package from http://www.microsoft.com/data/odbc as part of MDAC, the version is the newest version 2.7.0. But after I have installed this Package(RODBC) and

RE: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Charles Annis, P.E.
Found it! Here is the original ellipse function: -- From: Bishop, Lane[SMTP:[EMAIL PROTECTED] Sent: Monday, November 13, 2000 4:05 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject:RE: [S] 95% ellipse region Try this function: ellipse - function(loc, cov, confidence

Re: [R] Install Package(RODBC) warning , why?

2004-10-27 Thread Prof Brian Ripley
You are trying to use a package built for R 2.0.0 under R 2.0.0. How you managed to do that we have no idea, as RODBC is not available on http://www.microsoft.com/data/odbc! Almost certainly you got it from the wrong place, from CRAN/bin/windows/contrib/2.0/, so please do read the rw-FAQ and

[R] SJava loading --error!

2004-10-27 Thread ram
Hi list, I am having a problem in SJava. while loading the library I get the folowing error. library(SJava) Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library /usr/lib/R/library/SJava/libs/SJava.so: libRSNativeJava.so: cannot open shared

Re: [R] SJava loading --error!

2004-10-27 Thread Prof Brian Ripley
On Wed, 27 Oct 2004 [EMAIL PROTECTED] wrote: I am having a problem in SJava. while loading the library I get the folowing error. library(SJava) Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library /usr/lib/R/library/SJava/libs/SJava.so:

[R] se.contrast

2004-10-27 Thread I M S White
After a one-way anova, se.contrast computes the standard error of a contrast, but not the value of the contrast itself. Wouldn't this be useful? Am I missing something? == I.White ICAPB, University of Edinburgh Ashworth Laboratories, West Mains Road Edinburgh

Re: [R] Newbie question about the use of lm and anova

2004-10-27 Thread Henric Nilsson
At 12:54 2004-10-26 -0700, Sandie Peters wrote: [...] Several questions: 1. Why do we get a different ANOVA answer when we switch the order of the explanatory variables , e.g. ComponentA ~ Parent + Plot vs ComponentA ~ Plot + Parent? 2. Why are the Sum Sq and F ratios calculated by this ANOVA

Re: [R] se.contrast

2004-10-27 Thread Prof Brian Ripley
On Wed, 27 Oct 2004, I M S White wrote: After a one-way anova, se.contrast computes the standard error of a contrast, but not the value of the contrast itself. Wouldn't this be useful? Am I missing something? Compatibility with S, plus `does what it says on the box'. It was written to make

Re: [R] regexp,grep: capturing more than one substring

2004-10-27 Thread Gabor Grothendieck
Marc Mamin M.Mamin at intershop.de writes: : : Hello, : : I would like to have a function that retrieve matching strings in the same way as with java.util.regex (java 1.4.2). : : Example: : : f('^.*(xx?)\\.([0-9]*)$','abcxx.785') : = : c('xx','785') : : First of all: Is it possible to

Re: [R] ploting axes and rotating strings

2004-10-27 Thread Marc Schwartz
On Wed, 2004-10-27 at 08:34, Ale iberna wrote: Hello! I have two question that rose from trying to tacle the same problem in two differnet ways. What I want to do is to plot axes (only values or labels, no tick marks) in such a way that 'cex' can be very small, text can be perpendicular

Re: [R] ploting axes and rotating strings

2004-10-27 Thread partha_bagchi
Have you tried the adj parameter in par as in axis(side=3,at=0:100/100,labels=0:100,las=2,cex.axis=0.1, adj = 0.5) ? Ale iberna [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/27/2004 09:34 AM To: R-help [EMAIL PROTECTED] cc: Subject:[R] ploting

RE: [R] ploting axes and rotating strings

2004-10-27 Thread Ian Smith
Hi Ales, Think you might have made a typo, the parameter in par is srt not str, hope that helps. Regards, Ian Smith mangosolutions Tel +44 118 902 6620 Fax +44 118 902 6401 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ale¹ ®iberna Sent: 27 October

Re: [R] Random number

2004-10-27 Thread Kunal Shetty
thank you Sundar,Andy, Partha for your prompt reply. as for the %*% is matrix multiplication problem sunder here is a sample of what i want... x - rnorm(100,17,24) # X values y - rnorm(100,7,11) # Y values # since X and Y values are independent to get their # covariance need to multiply

Re: [R] Random number

2004-10-27 Thread Sundar Dorai-Raj
Kunal Shetty wrote: thank you Sundar,Andy, Partha for your prompt reply. as for the %*% is matrix multiplication problem sunder here is a sample of what i want... x - rnorm(100,17,24) # X values y - rnorm(100,7,11) # Y values # since X and Y values are independent to get their #

[R] Warning messages in function fitdistr (library:MASS)

2004-10-27 Thread De la Vega Góngora Jorge
Why the warning messages (2:4)? x - rexp(1000,0.2) fitdistr(x,exponential,list(rate=1)) rate 0.219824219 (0.006951308) Warning messages: 1: one-diml optimization by Nelder-Mead is unreliable: use optimize in: optim(start, mylogfn, x = x, hessian = TRUE, ...) 2: NaNs produced

Re: [R] Random number

2004-10-27 Thread David Forrest
On Wed, 27 Oct 2004, Kunal Shetty wrote: thank you Sundar,Andy, Partha for your prompt reply. as for the %*% is matrix multiplication problem sunder here is a sample of what i want... x - rnorm(100,17,24) # X values y - rnorm(100,7,11) # Y values # since X and Y values are

[R] writing lm summary to file?

2004-10-27 Thread John-J . Smith
Hi, I want to write the summary from a regression. I am doing this because I do not see a way of get the std error, tvalues from the coefficients diagnostic. n$coef does not give this only get the intercept and slope. I tried to use write and write.table and got error in both cases. I

Re: [R] Warning messages in function fitdistr (library:MASS)

2004-10-27 Thread Prof Brian Ripley
On Wed, 27 Oct 2004, De la Vega Góngora Jorge wrote: Why the warning messages (2:4)? The warnings are about your uninformed use of the function. You have read the reference (as the R posting guide asks) haven't you? You are trying to fit a distribution with parameter 0 by an *unconstrained*

Re: [R] writing lm summary to file?

2004-10-27 Thread Prof Brian Ripley
On Wed, 27 Oct 2004 [EMAIL PROTECTED] wrote: Hi, I want to write the summary from a regression. I am doing this because I do not see a way of get the std error, tvalues from the coefficients diagnostic. n$coef does not give this only get the intercept and slope. I tried to use write

Re: [R] persp(), scatterplot3d(), ... argument

2004-10-27 Thread Paul Murrell
Hi Jari Oksanen wrote: On Wed, 2004-10-27 at 10:04, Uwe Ligges wrote: Robin Hankin wrote: Hello list. I very often need 3d scatterplots, and use scatterplot3D quite a lot. I am trying to modify persp() to plot scatterplots, and make use of the theta and phi arguments that persp() offers. I am

[R] test

2004-10-27 Thread Rajdeep Das
[[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] integrate a function in R

2004-10-27 Thread yyan liu
Hi: I want to integrate the following function with respect to z, u is another argument in the function. My program is a loop and in each loop the argument u will be given a specified numeric values. But how can I use the integrate function with u in R? The function is: zfz-function(z,u) {

Re: [R] ploting an ellipse keeps giving errors

2004-10-27 Thread Sun
Dear Mr. Fox: Now I got things done using your ellipse in Package car! Just note to plot an empty plot before calling ellipse. And input the correct radius and covariance matrix (I input the inverse of the covariance matrix multiplied by n as the covariance matrix, that was wrong. n should go to

[R] Problem installing RandomFields package

2004-10-27 Thread Paul English
Hi, I'm running R 2.0 installed from the source port on FreeBSD 4.10 and I'm having some trouble installing the RandomFields package. Following is the procedure and errors: options(CRAN=http://cran.us.r-project.org;) install.packages(RandomFields) download snipped downloaded 227Kb *

[R] Problems installing GRASS package

2004-10-27 Thread Paul English
Hi, I'm running R 2.0 installed from the source port on FreeBSd 4.10 and I'm having trouble installing the GRASS package. Following is the procedure plus errors: options(CRAN=http://cran.us.r-project.org;) install.packages(GRASS) download snipped downloaded 186Kb * Installing *source*

Re: [R] Skewness and Kurtosis

2004-10-27 Thread Diethelm Wuertz
Hello, fBasics has functions for skewness and kurtosis: Comments on these functions are welcome! Diethelm Wuertz # ** kurtosis = function (x, ...) { # A function implemented by D. Wuertz # FUNCTION: UseMethod(kurtosis) } #