Displaying 20 results from an estimated 30000 matches similar to: "Reading in a value of .Random.seed in .Rprofile"
2006 Aug 30
10
.Rprofile under Windoze.
I am (for my sins) having to do some work using R under Windoze. I
wanted to set up a .Rprofile to control my set-up. The docs on
.Rprofile say that it can/should be placed in ``the user's home
directory''. ``An Introduction to R'' observes lucidly that this
concept needs to be clarified under Windoze.
Following the suggestions in An Introduction to R, I tried
putting a
2005 Jun 15
1
random number generator: same seed used in different sessions
I did several simulation sessions and the result turned out to be a
surprise. After some investigation, I found that different R sessions
of the program used the same seed. Simply, in R210, if I start R and
type rnorm(1), I always get the same random number. This is
contradictary to what is in the R document
Initially, there is no seed; a new one is created from the
current time when one
2004 Aug 25
5
S <-> R
Hello! I would like to be able to read in list data objects in R/S
created in R/S. (Ie R->S or S->R.) I have tried 'dput' and 'dump' in S,
but neither of the created files could be read into R (with 'dget' nor
'source'). Is there any way that I can save a list object in S that can
be read into R?
Sincerely,
Zachary Skrivanek, PhD
Research Scientist
2010 Aug 24
3
How to obtain seed after generating random number?
Dear all, I was doing an experiment to disprove some theory therefore
performing lot of random simulation. Goal is to show the audience that
although something has very rare chance to occur but it doesn't mean that
event would be impossible.
In this case after getting that rare event I need to show that same scenario
for multiple times to explain other audience. Hence I need to somehow
2000 Sep 11
2
.Random.seed resetting (PR#656)
Full_Name: Lara Jamieson
Version: 1.1.1
OS: Linux
Submission from: (NULL) (131.111.20.203)
I've checked for other reports on this and can't find anything. It seems that
the .Random.seed isn't updated properly after using rm(.Random.seed). Mu
understanding from the help file indicates that a new 'random' seed will be
generated.
It appears that sometimes the old one is just
2008 Aug 07
3
how to save an R object selectively?
Hi,
How to save an R object for example a matrix or vector and not all objects created in a session (which is usually performed by save.image or q("yes"))?
Best,
Carol
[[alternative HTML version deleted]]
2009 May 14
2
can you tell what .Random.seed *was*?
Dear R-help,
Suppose I write a script that looks something like this:
#### script.R
set.seed(something)
x <- rnorm(100)
y <- runif(500)
# bunch of other stuff
save.image()
### end of script.R
Now, I give you a copy of my script.R (with the set.seed statement
removed, of course) together with the .RData file that was generated
by the save.image() command.
Question:
1) can you tell
2014 Aug 11
1
Renviron.site and Rprofile.site in Fedora
On Debian/Ubuntu, system wide environment variables and options are
set in respectively /etc/R/Renviron.site and /etc/R/Rprofile.site.
These files are automatically created when r-base is installed, and do
not get overwritten during an upgrade.
On Fedora, there is no /etc/R directory. What is the recommended place
to define system wide environment variables and options on a Fedora
system?
2008 Apr 13
1
.Rprofile, date tagging history, loading packages
Dear R-Helpers,
I'm fiddling with my .Rprofile in Windows XP & R 2.7.0 Beta. I prefer to
manually save my workspace but automatically save my command history via
the .Rprofile. That is working fine once I found that "utils::" was
required before the loadhistory & savehistory functions. What I would
like to do is add a separator line with a date between the histories of
each
2004 Jun 10
1
.Random.seed saved in .RData
Is it intentional that the .Random.seed is saved in .RData? If people
run multiple sessions from the same directory they will get the same
intial seed setting, which seems a bit dangerous. I don't often save my
session nor run two sessions in the same directory, so I have never run
it this, but there was a question on r-help where it may have been an issue.
Paul Gilbert
2008 Jul 14
2
.First and .Rprofile won't run on startup
I'm trying to source a file automatically every time I start R. I tried
adding the following .First function in a file Rprofile.site in my
$R_HOME/etc/ directory (verified $R_HOME by Sys.getenv()) as well as in a
file .Rprofile in my $HOME directory and .Rprofile in the working directory:
.First <- function(){
source(file.path(Sys.getenv("HOME"), "R",
2003 Feb 06
2
.Rprofile, .Rfirst, and .Rdata
Hi all,
After a short hiatus away from R I have found that it's changed a bit.
I used to keep a definition of .First in .Rprofile that did a couple of
things on startup (load a couple of libraries). Now, I've discovered
that when I change the definition of .First in .Rprofile it doesn't
change anything when I start up, because .First is held over in .Rdata
from the last session.
2010 Oct 09
4
same random numbers in different sessions
Dear all
I'm using Xubuntu Lucid and I keep getting the same random numbers
whenever I start a new session of R. For example, I keep getting
> sample(1:1000, 1)
[1] 87
or
> rnorm(1:10)
[1] -1.3618103 0.4241701 1.0720076 0.2208145 -0.5375314 -0.4846588
[7] 0.7576768 0.6527407 -0.6868786 0.8718527
I expected that some set.seed() instruction woudl be present in a
config file in
2018 Sep 29
1
Improvement to documentation in dput.Rd
If the "Matrix" package is attached, 'example(dget)' fails:
> library(Matrix)
> example(dget)
dget> fil <- tempfile()
dget> ## Write an ASCII version of function mean to our temp file
dget> dput(mean, fil)
dget> ## And read it back into 'bar'
dget> bar <- dget(fil)
Error in initialize(value, ...) : '...' used in
2011 Aug 04
1
How to seed the R random number generator in C (standalone) with an instance of .Random.seed
hello all,
I use the R standalone math library in my own C program, and the default R
random number generator can be seeded with
set_seed(const unsigned int, const unsigned int).
How could I seed the RNG with an instance of .Random.seed ?
I would need this or a similar workaround for debugging purposes.
More precisely, I use the default R random number generator to sample from
various
2001 Mar 04
2
.Random.seed(0) is not a valid Normal type
Dear R-Developers and -Community,
after compiling and installing R 1.2.2., I started 'demo(graphics)' for
a test, and got:
'Error in rnorm(0): .Random.seed(0) is not a Normal type'
Obviously .Random.seed was not initialized appropriately. Following the
the documentation for '.Random.seed' [see below 'Examples'], this can be
fixed
rm(.Random.seed);
1999 Nov 27
1
.Rprofile results in corruption of .RData? (PR#346)
It could be that the following may be due to something wrong that I managed
to do (I cannot think what...) but I submit this report in case it is something
that you want to know about (I have solved the problem by removing .Rprofile as
I describe below).
1. After compiling/installing R 0.90 (an uneventful process), it
worked perfectly the first time, and it read .RData written by the
previous
2013 Jan 23
3
How to construct a valid seed for l'Ecuyer's method with given .Random.seed?
Dear expeRts,
I struggle with the following problem using snow clusters for parallel computing: I would like to specify l'Ecuyer's random number generator. Base R creates a .Random.seed of length 7, the first value indicating the kind fo random number generator. I would thus like to use the components 2 to 7 as the seed for l'Ecuyer's random number generator.
By doing so, I
2004 Apr 21
2
Assigning functions in Rprofile
I use the ugly hack shown below as my .Rprofile (mainly because I couldn't
find any other way to spawn a new mozilla window on starting R or calling
help.start(), but then send all the help html documents to that new
window).
With a recent change from a cvs checkout to the released 1.9.0 I find that
the new hs() appears if there is nothing of that name in .RData, but if
there is the old hs()
2008 Feb 13
3
Best way to reset random seed when using set.seed() in a function?
Hi,
this is related to a question just raised on Bioconductor where one
function sets the random seed internally but never resets it, which
results in enforced down streams random samples being deterministic.
What is the best way to reset the random seed when you use set.seed()
within a function? Is it still to re-assign '.Random.seed' in the
global environment as following example