Displaying 20 results from an estimated 900 matches similar to: "Random Number Generators and Sample"
2010 Aug 14
1
Creating list from a long vector
Stupid question, but its been a long night.
If I have a long vector how can I turn it into a list of the same length
x<-rep(seq(1,100,by=1),each=10)
[[alternative HTML version deleted]]
2010 Aug 20
1
Rserve (Anyone?)
REXP has an asBytes() method. Will this capture the output of an R plot
function if a proper graphics device is used? It appears R insists on
sending plot output to a file. Kind of strange since it insists on loading
all your data into memory before it can do anything.
If so then does anyone know what this would be? I prefer png or jpeg.
Example:
c is an RConnection
REXP r =
2010 Aug 20
1
R and Java
Hi folks,
Maybe that is not the best place to ask, but I 'd like some of you could
help me...
I'm using jri to run R commands under Java, by its examples I can eval
expressions, returning single values or vectors to my Java variables. But, I
would like to know how to assign the values of a Java vector (like: double
x[] = {1.7 , 2.8 , 3.4}; ) to a R variable, so I can eval a function
2010 Sep 06
1
c++ equivalent switch statement?
Is there a c++ equivalent switch statement in R?
--
Rajesh.J
[[alternative HTML version deleted]]
2010 Sep 01
2
Using packages built in linux in windows
Hi,
I built a package in linux and would like to use it in windows. I cant build
the package again in windows because it would miss the necessary libraries
etc(I'm using Rcpp). So I need to generate a binary version and try to
install it in windows. I tried this and I get the error
/cygdrive/RTools/bin/cp: target 'xf->>' is not a directory
Can someone help me with this?
--
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
2010 Sep 15
3
characters in a string
Hi,
I need to check if a string "<rh>a,b,c,d<rh>" is delimited by two "<rh>" 's as efficiently as possible(I need to do this a lot of times) and return TRUE. Can someone suggest a good technique?
[[alternative HTML version deleted]]
2010 Sep 26
2
get absolute file path
Hello,
I get a value which stores a relative file name. (I get it from another
function, which I don't want to change.)
e.g.
> fileName <- "../data/2010-08.csv";
Is it possible to get the absolute file path out of this value?
(e.g. /home/sebastian/documents/data/2010-08.csv)
Kind regards,
Sebastian
2010 Sep 28
1
How to convert SEXP to double
Hello All,
A simple question.
I get some return from the R in my C++ program (via Rcpp package). The
result come, as SEXP and it should be a simple numeric variable.
How to convert it to double?
The code, what i use:
stringstream ss;
ss << "p <- predict(fit_ar11, n.ahead = 2, doplot=FALSE);"
<< "p$pred[1]";
SEXP ans;
int iRet =
2010 Aug 13
2
cacheSweave / pgfSweave driver for package vignette
Dear list,
I wish to use a specific driver to process an sweave document in the
inst/doc directory of a package. Specifically, I would like to use
either cacheSweave or pgfSweave to speed up the creation of the
vignette which requires lengthy computations. The same request would
also apply to the highlight driver, to provide syntax highlighting of
R chunks.
In "writing R extensions" I
2010 Aug 13
2
cacheSweave / pgfSweave driver for package vignette
Dear list,
I wish to use a specific driver to process an sweave document in the
inst/doc directory of a package. Specifically, I would like to use
either cacheSweave or pgfSweave to speed up the creation of the
vignette which requires lengthy computations. The same request would
also apply to the highlight driver, to provide syntax highlighting of
R chunks.
In "writing R extensions" I
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
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
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 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 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
2006 Dec 12
2
R_Code
Hello!
I need the Code of the functions runif and rexp. Where can I get them? Can You help me?
I thank you for an answer!
bye Ilka
--