[R] uniform number

2014-05-04 Thread Ragia Ibrahim
Dear group, How to generate uniform probability choosing p to be 2% and 5%, in separate trials for 100 times. thanks in advance RAE [[alternative HTML version deleted]] __ R-help@r-project.org mai

Re: [R] regexec: Unexpected answer when matching digits

2014-05-04 Thread Prof Brian Ripley
On 05/05/2014 00:26, Stephen Sentoff wrote: Here is my sessionInfo from the linux machine where I see this behavior. R version 3.1.0 (2014-04-10) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 [4] LC_COLLATE=en_US.UTF-8 LC_

[R] function to compare lengths of objects?

2014-05-04 Thread Spencer Graves
Is there a standard function to generate messages like "longer object length is not a multiple of shorter object length" but providing more information like the names of the objects? For example, "a/b" issues, "Warning message: In a/b : longer object length is not a multiple of s

[R] MLE

2014-05-04 Thread pari hesabi
Hello I know how to use R for estimating a parameter by using MLE if I have a simple function f(x,a). I am trying to design a program for a complicated function such as: g(.)=sum(integral(f(x,a,t,k))) where (a) is a parameter(needs to be estimated) , integral depends on (t) and sum is over (k)

Re: [R] regexec: Unexpected answer when matching digits

2014-05-04 Thread Stephen Sentoff
Here is my sessionInfo from the linux machine where I see this behavior. R version 3.1.0 (2014-04-10) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8

Re: [R] regexec: Unexpected answer when matching digits

2014-05-04 Thread Duncan Murdoch
On 04/05/2014, 5:03 PM, Stephen Sentoff wrote: I was trying to use regexec to extract number fields from my data and got an unexpected response. I can reproduce the issue with this small test case. regexec("\\d{2,}", "abcd123") I get a match at position 1, for length 7. Not what I expected.

[R] regexec: Unexpected answer when matching digits

2014-05-04 Thread Stephen Sentoff
I was trying to use regexec to extract number fields from my data and got an unexpected response. I can reproduce the issue with this small test case. regexec("\\d{2,}", "abcd123") I get a match at position 1, for length 7. Not what I expected. I do get the expected response (match at positi

Re: [R] Tick marks at the 0:0 point in a plot ()

2014-05-04 Thread Rui Barradas
Hello, With ylim = c(100, 800) you can't get it to start at point (0, 0). Try ylim = c(0, 800) instead. Hope this helps, Rui Barradas Em 04-05-2014 18:19, Ahmed Attia escreveu: Dear R usres, Sorry to bother you with my basic question. I have a quick question about tick mark in R. A reviewer

Re: [R] Problem with products in R ?

2014-05-04 Thread Ted Harding
Thanks for this link, Gabor (and especially for the link therein to your posting on Thu May 7 14:10:53 CEST 2009). This confirms that the R 'bc' package is not on CRAN and points to where it can be sourced from. I used to have bc.R installed on an old machine, which has gone into terminal coma now.

[R] Tick marks at the 0:0 point in a plot ()

2014-05-04 Thread Ahmed Attia
Dear R usres, Sorry to bother you with my basic question. I have a quick question about tick mark in R. A reviewer wants the tick marks of the graph to start at 0:0 point. My current code below produces the tick mark a little far from the corner; plot(Simu2~Irrig, data=Ahmed,pch=17, col=1,subset=

Re: [R] Problem with products in R ?

2014-05-04 Thread Gabor Grothendieck
Checking this with the bc R package (https://code.google.com/p/r-bc/), the Ryacas package (CRAN), the gmp package (CRAN) and the Windows 8.1 calculator all four give the same result: > library(bc) > bc("168988580159 * 36662978") [1] "6195624596620653502" > library(Ryacas) > yacas("168988580159 *

Re: [R] Problem with products in R ?

2014-05-04 Thread Ted Harding
On 04-May-2014 14:13:27 Jorge I Velez wrote: > Try > > options(digits = 22) > 168988580159 * 36662978 ># [1] 6195624596620653568 > > HTH, > Jorge.- Err, not quite ... ! I hitch my horses to my plough (with help from R): options(digits=22) 168988580159*8 = 1351908641272 (copy down) 168988580159*

Re: [R] Problem with products in R ?

2014-05-04 Thread peter dalgaard
On 04 May 2014, at 16:13 , Jorge I Velez wrote: > Try > > options(digits = 22) > 168988580159 * 36662978 > # [1] 6195624596620653568 But the last 5 digits are supposed to match those of > 80159 * 62978 [1] 5048253502 so the result is off by 66. Further analysis will likely reveal rounding

Re: [R] knitr - Highlight code/output

2014-05-04 Thread Stephen Sentoff
Adding a line like options(width=60) should make the R output narrower, so that it will fit into the highlighted frame. If you don't want to see this line, you can put it into a separate chunk that isn't echoed. -- Steve Sentoff shsent...@comcast.net __

Re: [R] Problem with products in R ?

2014-05-04 Thread Jorge I Velez
Try options(digits = 22) 168988580159 * 36662978 # [1] 6195624596620653568 HTH, Jorge.- On Sun, May 4, 2014 at 10:44 PM, ARTENTOR Diego Tentor < diegotento...@gmail.com> wrote: > Trying algorithm for products with large numbers i encountered a difference > between result of 168988580159 * 366

Re: [R] Problem with products in R ?

2014-05-04 Thread peter dalgaard
On 04 May 2014, at 14:44 , ARTENTOR Diego Tentor wrote: > Trying algorithm for products with large numbers i encountered a difference > between result of 168988580159 * 36662978 in my algorithm and r product. > The Microsoft calculator confirm my number. > > 168988580159 * 36662978 [1] 6.19

Re: [R] Problem with products in R ?

2014-05-04 Thread Frede Aakmann Tøgersen
Wow do you trust Windows calculator with those large numbers In fact do you at all trust Windows calculator??? Try to do this calculation 3 +8*5 in windows calculator. In standard view you get 55 In scientific view you get 43. Try it yourself!! Do you know the right answer? T

[R] Problem with products in R ?

2014-05-04 Thread ARTENTOR Diego Tentor
Trying algorithm for products with large numbers i encountered a difference between result of 168988580159 * 36662978 in my algorithm and r product. The Microsoft calculator confirm my number. Thanks. -- *Gráfica ARTENTOR * de Diego L. Tentor Echagüe 558 Tel.:0343 4310119

Re: [R] Construction of Optimal Designs in the Language R

2014-05-04 Thread Patrick Burns
The Experimental Design task view seems like a reasonable place to start: http://cran.r-project.org/web/views/ExperimentalDesign.html Pat On 03/05/2014 08:27, kabir opeyemi wrote: Dear All, Please can someone help advise on procedures for construction of optimal designs and estimation of para