similar to: R_Code

Displaying 20 results from an estimated 2000 matches similar to: "R_Code"

1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the order of the arguments. This is an example: > rpois(n=1,lambda=2) [1] 3 > rpois(lambda=2,n=1) [1] 2 0 It obviously uses the first argument as the number of samples to be drawn, which is wrong. I used Version 0.49 Beta (April 23, 1997). Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the order of the arguments. This is an example: > rpois(n=1,lambda=2) [1] 3 > rpois(lambda=2,n=1) [1] 2 0 It obviously uses the first argument as the number of samples to be drawn, which is wrong. I used Version 0.49 Beta (April 23, 1997). Fredrik
2011 Mar 18
1
[Patch suggestion] Adding 3rd arg to tempfile() to set extension
The other day I was working on an example which used tempfile() to create file for use by the graphics device. And while I love tempfile()---as it is portable and clever and the files get cleaned by R and all that---I noticed one missing feature I would like to see: beside a starting name pattern, and an optional directory, an 'file extension' argument would be nice to have. As e.g. in
2008 Feb 29
1
patch for random.c
Dear all, while looking for some inspiration of how to organise some code, I studied the code of random.c and noticed that for distributions with 2 or 3 parameters the user is not warned if NAs are created while such a warning is issued for distributions with 1 parameter. E.g: R version 2.7.0 Under development (unstable) (2008-02-29 r44639) [...] > rexp(2, rate=Inf) [1] NaN NaN Warning
2006 Jan 17
1
how can i locate the source code of a module quickly?
I have dowloaded the Source Code of R,and I want to know the process of chi-sqared test,but how can I found it? [[alternative HTML version deleted]]
2004 Jul 02
2
hclust
im using plclust and want the labels to be different colors. i took a look at getS3method("plot","hclust") and saw a call to .Internal. i looked at the help on .Internal and dont know where to go next. any help appreciated! thanks, rafael
2006 Jun 14
2
Saving R graphics with version 2.3.1
HI ! I?ve installed the latest R version (2.3.1) and I?ve had problems to save my graphics as JPEG, PNG and the others available formats. R saves the file with no extension. Then, I have to open this file using an image visualizer and save it as PNG, for instance. Previous R versions work without problems. Has everyone had a similar problem? Is it a bug of R 2.3.1? Thanks in advance. Ilka
2003 Oct 22
1
Windows RConsole Focus
Hi, I was looking for a Windows-specific R function to focus the console window and couldn't find one. The motivation is that after loading the tcltk package, the "main" Tk window "." is presumably focused but then immediately withdrawn (hidden) so the RConsole loses its focus and you have to click on it to continue typing. Would there be any interest in including a
2003 Aug 26
4
Viewing function source
I know I should probably RTFM for this question, but could someone tell me if R supports the idea of "viewing source" on any particular function you want to use? If I want to "view source" on the rpois() function, for example, can I do somethink like: source(rpois) To see how the function is implemented? Regards, Paul Meagher Datavore Productions 50 Wood Grove Drive
2003 Dec 31
2
Calling primitive functions from C code
Does anyone have an example of calling primitive or internal functions from C code that they would share with me? I am having trouble trying to figure out how to construct the proper arguments to pass to "do_subset_dflt" Here is the prototype: SEXP do_subset_dflt(SEXP call, SEXP op, SEXP args, SEXP rho); The R_FunTab from "names.c" gives some additional information on the
2003 Dec 31
2
Calling primitive functions from C code
Does anyone have an example of calling primitive or internal functions from C code that they would share with me? I am having trouble trying to figure out how to construct the proper arguments to pass to "do_subset_dflt" Here is the prototype: SEXP do_subset_dflt(SEXP call, SEXP op, SEXP args, SEXP rho); The R_FunTab from "names.c" gives some additional information on the
2010 Aug 16
2
Random Number Generators and Sample
I am trying to get documentation about the random number generator used in "sample". The help for sample does not mention it. Can anyone point me in the right direction. Thanks [[alternative HTML version deleted]]
2008 Nov 19
1
How to look within .Internal ?
In the optim() function there is a syntax : res <- .Internal(optim(par, fn1, gr1, method, con, lower, Here how can I see the inside-codes of ".Internal" function ? Regards, -- View this message in context: http://www.nabble.com/How-to-look-within-.Internal---tp20581897p20581897.html Sent from the R help mailing list archive at Nabble.com.
2005 Apr 20
2
how to get code of a .Internal() function?
Hello, I'm working with the function optim() from stats package, and inside this function is called the function .Internal(optim(....)) and I want to get the code of this function which would help me to understand why the Nelder-Mead algorithm doesn't converge with my data. I'm working under Windows XP. Could you reply to this adress because I don't belong to the mailing list
2010 May 24
1
Functioning and source code location of .Primitive()
Hi all. I began examining the R source code in the last few days, for a better understanding of its structure. I read the manuals and digged deeply (maybe not enough?) into the source code, but I couldn't totally understand how .Primitive() works. Its effects, if I understand well, are quite clear to me (calling the C compiled counterpart of a "primitive" function), but where is its
2003 Jul 09
2
.Internal(optim)
> hi all, > I am using optim. I am getting the following error message: > > Error in optim(par = start.vals[, h], fn = post.func.pois, gr = post.grad. > pois, : > L-BFGS-B needs finite values of fn > > If I look at optim typing '> optim' it seems that the error comes from > inside .Internal(optim), so I wonder how can I see the code for .Internal(
2006 Feb 03
2
Problems with ks.test
Hi everybody, while performing ks.test for a standard exponential distribution on samples of dimension 2500, generated everytime as new, i had this strange behaviour: >data<-rexp(2500,0.4) >ks.test(data,"pexp",0.4) One-sample Kolmogorov-Smirnov test data: data D = 0.0147, p-value = 0.6549 alternative hypothesis: two.sided >data<-rexp(2500,0.4)
1999 Aug 30
1
rexp and rweibull
In splus rexp() and rweibull() are related: > set.seed(153) > rexp(1) [1] 0.0493267 > set.seed(153) > rweibull(1, shape=1) [1] 0.0493267 (you can also try shape =2, then rweibull = sqrt(rexp) ) However, in rw0.64.1 (on Win NT) they are different > .Random.seed <- 1:4 > rexp(1) [1] 1.412030 > .Random.seed <- 1:4 > rweibull(1, shape=1) [1] 2.054032 May be rweibull
2006 Aug 15
1
rexp question
I am using rexp to generate several exponential distributions. I am passing rexp a vector of rates , r. I am wanting to simulate a sample of size 200 for each rate so the code looks like: rexp(n=200*length(r),rate=r) this gives me a vector of the random exponential variables, but they are all disjointed b/c rexp goes through and simulates an exponential variable for each rate and it does that 200
2017 Oct 27
2
How to do a "Box's M" Test with
Trying to get past a frustrating error to do a "simple" Box's M test using Java. The Box's M test says it will work with a data.frame. Here's the setup code: REXP myDf = REXP.createDataFrame(new RList( new REXP[] { new REXPDouble(d1), new REXPDouble(d2), new REXPDouble(d3), new REXPDouble(d4), new REXPInteger(d5) })); Here's the call: REXP boxMResult =