Re: [R] wireframe 3-D problems

2009-05-17 Thread Ben Bolker
Xu Jun wrote: I am trying to graph a 3-D graph of simulated data for logit models using the powerful wireframe command, but I got stuck. Here are the codes: x - seq(-4, 4, by=0.01) y - seq(-4, 4, by=0.01) p - 1/(1+exp(-0.12*x + 0.35*y)) mydata - cbind(x, y, p) require(lattice)

Re: [R] Newton's method for finding roots

2009-05-17 Thread Dieter Menne
Kon Knafelman konk2001 at hotmail.com writes I need to use netwon's method to find the root of a polynomial, .. It't time to get your homework date May 12 submitted. http://markmail.org/message/x5vdbync3gxfs5hp Dieter __ R-help@r-project.org

Re: [R] Using column length in plot gives error

2009-05-17 Thread Dieter Menne
MikSmith mike at hsm.org.uk writes: I'm trying to write a generic script for processing some data which finishes off with some plots. Given Im never sure how many columns will be in my dataframe I wanted to using the following plot(spectra.wavelength, cormat, type = l, ylim=c(-1,1),

[R] Simulation Help

2009-05-17 Thread Kon Knafelman
Hey Guys, i need 1000 samples of size 15, for distributions of Exp(1) and Norm(0,1). here is what i have done so far.For the exponential z-list() for(i in 1:1000){z[[i]]=rexp(15,1)} For the Normal y-list() for(i in 1:1000){y[[i]]=rnorm(15,0,1)} Is this correct? after this i need to

[R] Row number of minimum value?

2009-05-17 Thread MikSmith
Hi This *must* be an insanely easy thing to work out, but I'm not too familiar with R syntax. So how do I work out the row number (if I pass a column) of the minimum value?? I can get the value itself from min(), but where can I get the row?? Many thanks mike -- View this message in context:

[R] Croston's

2009-05-17 Thread s80url
Hi, Can anyone advise on the most appropriate way to use the Croston's function in the Forecast package. I have high intermittent demand and am interested in predicting sales trends. Is this possible? What is meant by this statement in the help file: Note that prediction intervals are not

[R] Kumar quantile

2009-05-17 Thread prixel
can someone please help me with this problem. i found the density and distribution for the Kumar~(2.3,3.2), but now im stuck on the quantile. how do i determine the quantile for kumar with Inverse F(0.5). im trying to use qkumar(_,2.3,3.2). but im stuck on determing the probability vector.

Re: [R] Row number of minimum value?

2009-05-17 Thread Adrian Dusa
Hi Mike, On Sunday 17 May 2009, MikSmith wrote: Hi This *must* be an insanely easy thing to work out, but I'm not too familiar with R syntax. So how do I work out the row number (if I pass a column) of the minimum value?? I can get the value itself from min(), but where can I get the row??

[R] Asymmetric t - copula code in R

2009-05-17 Thread Roslina Zakaria
Hi R-users, Where can I find the code for asymmetric t-copula in R? Thank you for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] replace % with \%

2009-05-17 Thread Michael Dewey
At 15:46 15/05/2009, Liviu Andronic wrote: Dear all, I'm trying to gsub() % with \% with no obvious success. Hello Liviu, When I posted a similar question a few years ago one helpful response introduced me to nchar nchar(%) [1] 1 nchar(\%) [1] 1 Warning messages: 1: '\%' is an unrecognized

Re: [R] converting numeric to integer

2009-05-17 Thread Linlin Yan
On Sun, May 17, 2009 at 5:00 PM, Thomas Mang thomas.m...@fiwi.at wrote: Hi, Well, also not quite. Suppose x = 5.001 (in finite binary represenation). Then I want x == 5, but that is of course an integer which is now less than the original numeral. Sorry for that I haven't got what

Re: [R] converting numeric to integer

2009-05-17 Thread Gabor Grothendieck
Try: as.integer(x + 0.5) assuming the calculation error is less than 0.5 . On Sat, May 16, 2009 at 2:49 PM, Thomas Mang thomas.m...@fiwi.at wrote: Hello, Suppose I have x, which is a variable of class numeric. The calculations performed to yield x imply that mathematically it should be an

Re: [R] converting numeric to integer

2009-05-17 Thread Thomas Mang
Hi, The problem is, x might be negative. If x == -6.999, the result should be -7, not -6. That's why my original proposal had the ifelse-condition (one could alternatively write sign(x) * 0.5, BTW. I agree however that in my proposal, the round(x) is redundant, one can use x itself as

Re: [R] converting numeric to integer

2009-05-17 Thread Gabor Grothendieck
Try this: as.integer(x + sign(x) * .5) On Sun, May 17, 2009 at 6:01 AM, Thomas Mang thomas.m...@fiwi.at wrote: Hi, The problem is, x might be negative. If x == -6.999, the result should be -7, not -6. That's why my original proposal had the ifelse-condition (one could alternatively

Re: [R] Using column length in plot gives error

2009-05-17 Thread MikSmith
Hi Stephanie Absolutely right! My CSV was imported as a factor. Reading the R FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f I actually need to do: as.numeric(as.character(spectra.wavelength)) to get back to my original data. Many thanks for the

Re: [R] Row number of minimum value?

2009-05-17 Thread MikSmith
Hi Adrian Many thanks. That works perfectly! It's easy when you know the answer :) mike Adrian Dusa wrote: Hi Mike, On Sunday 17 May 2009, MikSmith wrote: Hi This *must* be an insanely easy thing to work out, but I'm not too familiar with R syntax. So how do I work out the row

[R] package for /usr/lib64/R/library/tkrplot/libs/tkrplot.so

2009-05-17 Thread Juergen Rose
Hi, 'revdep-rebuild' under GENTOO shows me that /usr/lib64/R/library/tkrplot/libs/tkrplot.so, which was installed at April 24th, is broken. 'ldd /usr/lib64/R/library/tkrplot/libs/tkrplot.so' shows me that tkrplot.so needs libtcl8.4.so and libtk8.4.so, which is no more installed since the

Re: [R] replace % with \%

2009-05-17 Thread Gabor Grothendieck
Having some way to specify strings which does not involve special interpretation of backslashes is a frequent wish list item that would be helpful for latex, Windows path names and regular expressions. A review of delimiter collision approaches by different languages can be found here:

Re: [R] Row number of minimum value?

2009-05-17 Thread Uwe Ligges
Adrian Dusa wrote: Hi Mike, On Sunday 17 May 2009, MikSmith wrote: Hi This *must* be an insanely easy thing to work out, but I'm not too familiar with R syntax. So how do I work out the row number (if I pass a column) of the minimum value?? I can get the value itself from min(), but where

Re: [R] wireframe 3-D problems

2009-05-17 Thread Xu Jun
Ben, Thank you for your help! Jun [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Question about barplot: gridlines value labels

2009-05-17 Thread Jim Lemon
Dimitri Liakhovitski wrote: Hello! I promise I looked into help files before asking. Still cannot figure it out. I think it's because I am totally confused what packages use lettice, which use trellis, etc. Sections 1 and 2 below produce the data and the data to plot. My question is about

[R] (no subject)

2009-05-17 Thread Debbie Zhang
Dear R users, I incurred some problems with importing data into R. i.e. If I want to import a text file or word file which contains lots of numerical numbers, what function should I use? Please help. Thanks a lot. Debbie

Re: [R] (no subject)

2009-05-17 Thread Johannes Hüsing
Debbie Zhang schrieb: Dear R users, I incurred some problems with importing data into R. i.e. If I want to import a text file or word file which contains lots of numerical numbers, what function should I use? It does help if you read the posting guide first. In general, the file has to

Re: [R] Lattice scales question: using at when log = TRUE

2009-05-17 Thread Afshartous, David
On my machine the 10^1 tick mark does not show up. sessionInfo() R version 2.9.0 (2009-04-17) i386-apple-darwin8.11.1 locale: en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached

Re: [R] Lattice scales question: using at when log = TRUE

2009-05-17 Thread Gabor Grothendieck
There is no reason to think it would show up since its outside the range of your data. Use ylim to expand the range of the axis if you want it. On Sun, May 17, 2009 at 10:29 AM, Afshartous, David dafshart...@med.miami.edu wrote: On my machine the 10^1 tick mark does not show up.

Re: [R] ode first step

2009-05-17 Thread Benoit Boulinguiez
Thanks to Dieter Menne and Spencer Graves I started to get my way through lsoda() Now I need to use it in the nls() to assess the parameter. I've tried with a basic example dy/dt = K1*conc I try to assess the value of K1 from a simulated data set with a K1 close to 2. I'm not sure that I'm

[R] Output of binary representation

2009-05-17 Thread Ted Harding
I am interested in studying the binary representation of numerics (doubles) in R, so am looking for possibilities of output of the internal binary representations. sprintf() with format a or A is halfway there: sprintf(%A,pi) # [1] 0X1.921FB54442D18P+1 but it is in hex. The following

Re: [R] bagged importance estimates in earth problem

2009-05-17 Thread Max Kuhn
I was trying to produced bagged importance estimates of attributes in earth using the caret package with the following commands:  fit2 - bagEarth(loyalty ~ ., data=model1, B = 10)  bagImpGCV - varImp(fit2,value=gcv) My bootstrap estimates are produced however the second command varImp

Re: [R] data summary and some automated t.tests.

2009-05-17 Thread David Freedman
You might want to try using a non-parametric test, such as wilcox.test. How about some modification of the following: d=data.frame(grp=rep(1:2,e=5),replicate(10,rnorm(100))); head(d) lapply(d[,-1],function(.column)wilcox.test(.column~grp,data=d)) David Freedman stephen sefick wrote: Up

Re: [R] Output of binary representation

2009-05-17 Thread Gabor Grothendieck
gsubfn of the gsubfn package is like gsub but can take a function, list or proto object as the replacement instead of a character string and with a list it can be used to readily turn hex to binary: library(gsubfn) binary.digits - + list(0= , 1= 0001, 2= 0010, 3= 0011, + 4= 0100, 5=

Re: [R] Newton's method for finding roots

2009-05-17 Thread spencerg
Search on the left under www.r-project.org provide 5 different search engines devoted to R. The R-help archives for 4/20/2009 (+/-1 depending on your local time zone and mine) contains an interesting discussion of this issue, Subj: Re: [R] Two or more dimensional root (Zero) finding.

Re: [R] package for /usr/lib64/R/library/tkrplot/libs/tkrplot.so

2009-05-17 Thread Dirk Eddelbuettel
On 17 May 2009 at 12:53, Juergen Rose wrote: | 'revdep-rebuild' under GENTOO shows me | that /usr/lib64/R/library/tkrplot/libs/tkrplot.so, which was installed | at April 24th, is broken. | 'ldd /usr/lib64/R/library/tkrplot/libs/tkrplot.so' shows me that | tkrplot.so needs libtcl8.4.so and

[R] plotting a chisquare

2009-05-17 Thread Harry P
Dear R-users, I have a problem in making a chi-square density function curve. I have sth like curve(dchisq(x, df)) from help, x is vector of quantiles, df is the degree of freedom. I do not understand what vector of quantiles is, what do I need to put in? Thanks! -- View this message in context:

Re: [R] What's a Data Frame?

2009-05-17 Thread cls59
prixel wrote: im completely confused. could someone please help. i have a series of data (0,0,0,0,1,1,0,0,0) and i need to create a data frame with it. but what is a data frame? thankyou :) A data frame is similar to a matrix- however each column may be of a different data type

Re: [R] Output of binary representation

2009-05-17 Thread jim holtman
Are you looking for how the floating point is represented in the IEEE-754 format? If so, you can use writeBin: writeBin(pi,raw(),endian='big') [1] 40 09 21 fb 54 44 2d 18 On Sun, May 17, 2009 at 1:23 PM, Ted Harding ted.hard...@manchester.ac.ukwrote: I am interested in studying the binary

Re: [R] Output of binary representation

2009-05-17 Thread Ted Harding
Many thankis, Gabor! That looks both interesting and powerful. Indeed, it seems to implement with one stroke what I had been thinking of implementing piecemeal. Best wishes, Ted. On 17-May-09 17:48:00, Gabor Grothendieck wrote: gsubfn of the gsubfn package is like gsub but can take a function,

[R] build CONTENTS or 00Index.html without installing whole package

2009-05-17 Thread Jonathan Baron
To maintain my R site, I'm trying to install html help files only, but also keep track of the version (with DESCRIPTION). I have the following bash script, which works except for 00Index.html. That is not a huge problem because the help files are still searchable, but I'd like to fix it. A long

[R] Chow test(1960)/Structural change test

2009-05-17 Thread Axel Leroix
Hi,   A question on something which normally should be easy !   I perform a linear regression using lm function:   reg1 - lm (a b+c+d, data = database1)   Then I try to perform the Chow (1960) test (structural change test) on my regression. I know the breakpoint date. I try the following

Re: [R] Output of binary representation

2009-05-17 Thread Ted Harding
Thanks, Jim. While that is still in hex, I find I can get the binary represntation using Gabor's gsubfn() function, provided the A-F isw changed to a-f in setting up his 'binary.digits', and the output is explicitly cast to character: gsubfn([0-9a-f], binary.digits,

Re: [R] Output of binary representation

2009-05-17 Thread Gabor Grothendieck
Also note that one can use toupper in place of as.character in which case no other changes are required. On Sun, May 17, 2009 at 5:07 PM, Ted Harding ted.hard...@manchester.ac.uk wrote: Thanks, Jim. While that is still in hex, I find I can get the binary represntation using Gabor's gsubfn()

Re: [R] Chow test(1960)/Structural change test

2009-05-17 Thread Achim Zeileis
On Sun, 17 May 2009, Axel Leroix wrote: Hi,   A question on something which normally should be easy !   I perform a linear regression using lm function:   reg1 - lm (a b+c+d, data = database1)   Then I try to perform the Chow (1960) test (structural change test) on my regression. I know

Re: [R] package for /usr/lib64/R/library/tkrplot/libs/tkrplot.so

2009-05-17 Thread Juergen Rose
Am Sonntag, den 17.05.2009, 13:16 -0500 schrieb Dirk Eddelbuettel: On 17 May 2009 at 12:53, Juergen Rose wrote: | 'revdep-rebuild' under GENTOO shows me | that /usr/lib64/R/library/tkrplot/libs/tkrplot.so, which was installed | at April 24th, is broken. | 'ldd

[R] sprintf() question

2009-05-17 Thread Daniel Nordlund
When I type the following, I get results different from what I expected. sprintf('%a',3) [1] 0x1.8 Shouldn't the result be [1] 0x1.8p+2 I read through the help ?sprintf and didn't find anything that changed my expectation. What am I misunderstanding? I am using R-2.9.0 binary from CRAN

Re: [R] sprintf() question

2009-05-17 Thread Ted Harding
On 17-May-09 22:03:19, Daniel Nordlund wrote: When I type the following, I get results different from what I expected. sprintf('%a',3) [1] 0x1.8 Shouldn't the result be [1] 0x1.8p+2 Well, not p+2 but p+1 (0x1.8 = 1.1000[2] ; *2 = 11.000[2] = 3[10]) ; however, I get:

[R] One Sample Nonparametric

2009-05-17 Thread Charles Van deZande
Hi! I'm doing one and two sample nonparametric tests for the median using wilcox test. For a one-sample test I use: wilcox.test(x, mu =50 (or whatever), y=NULL,correct=TRUE) For two-sample test I use: wilcox.test(x,y,correct=TRUE) The problem is when I try to duplicate problems from

Re: [R] ggplot2: annotating plot with mathematical formulae

2009-05-17 Thread Paul Murrell
Hi Would a basic call to grid.text() do what you want here? Paul Paul Emberson wrote: Hi Baptiste, I think on this occasion I'll edit manually in inkscape with the textext plugin which is a somewhat clumsy but simple option. Thanks for the link to the wiki which I wasn't aware of until

Re: [R] sprintf() question

2009-05-17 Thread Daniel Nordlund
-Original Message- From: Ted Harding [mailto:ted.hard...@manchester.ac.uk] Sent: Sunday, May 17, 2009 3:32 PM To: Daniel Nordlund Cc: r-help@r-project.org Subject: RE: [R] sprintf() question On 17-May-09 22:03:19, Daniel Nordlund wrote: When I type the following, I get results

[R] Measures

2009-05-17 Thread Rafael Marconi Ramos
Dear colleagues in R, Has anybody implemented the 1) (Goodman Kruskal) lambda 2) (Thiel's) uncertainty coefficient Tanks Rafael M Ramos [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] About Error: C stack usage is too close to the limit

2009-05-17 Thread goon83
Hi everyone! I meet one problem when embedding R in C code, when I run the the R code in one child thread , it always print error info: Error: C stack usage is too close to the limit I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-ext doc

[R] asymmetric t-copula in R

2009-05-17 Thread Roslina Zakaria
Hi R-users, Where can I find the code for asymmetric t-copula in R? Thank you for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] How to run Rcmdr in Mac Os X Tiger?

2009-05-17 Thread Jenny Tan (Dr J)
This question might been asked previously (I googled), but I can't find a workable solution in the archives. My question is: how to run Rcdmr in Mac Os X? The error message when I launched Rcmdr fresh from a R session is: Version of R: R 2.8.1 GUI 1.27 Tiger build 32-bit (5301) library(Rcmdr)

[R] How do you save in R?

2009-05-17 Thread prixel
I know it sounds like a silly question but whenever i click on save to file it doesn't save. whenever i use the function attach(___) it doesn't work, and says object can not be found. i have a series of data (0,0,0,1,1) that i need to save, then i want to attach(...) it in another R window.