ut, however, that the initialization by array from 2002 is
more careful than the single number initialization, So, it is better to
use the array initialization even for a single number seed.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
or example,
MD5 cannot be used for cryptography any more, since there are known
algorithms to break it. However, if you use it for a simulation,
then the simulation will be biased only if it contains an algorithm,
which breaks MD5. The probability that this happens just by chance
is small.
Petr Sav
to the initial
state of the generator using a function, for which we have a good
guarantee that it produces output, which is computationally hard to
distinguish from truly random numbers. For this purpose, i suggest
to use the package rngSetSeed provided currently at
http://www.cs.cas.cz/~sav
On Wed, Feb 22, 2012 at 12:17:25PM -0600, Paul Johnson wrote:
[...]
> In order for this to be easy for users, I need to put the init streams
> and set current stream functions into a package, and then streamline
> the process of creating the seed array. My opinion is that CRAN is
> now overflowed
on but didn't find any information about
> that.
Package CORElearn (i am a coauthor) uses random number generation
under OpenMP in C++. This requires to have a separate copy of the
generator with its own memory for each thread.
Do you want to use
<- runif(n)
set.seed(seed2)
y <- runif(n)
rbind(seed1, seed2)
table(x[-1] == y[-n])
The output is
[,1]
seed1 124370417
seed2 205739774
FALSE TRUE
5 994
This means that if the streams x, y are generated from the two
seeds above, then y is
can compute s_{i,j} by an efficient algorithm.
> The different thing in my approach is that I'm saving one row of seeds
> per simulation "run". So each run can be replicated exactly.
>
> I hope.
Saving .Random.seed should be a safe strategy.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
lization using the vector c(seed, i, j) is done
with a good quality hash function, the runs will be independent.
What is your opinion on this?
An advantage of seeding with a vector is also that there can
be significantly more initial states of the generator among
which we select by the seed than 2^32, which is the maximum
for a single integer seed.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
N], which consists of replicated components
of X, has the expanded covariance matrix n times n, which you ask
for. Since the mean and the covariance matrix determine the distribution
uniquely, this is also a description of the required distribution.
The distr
1 it doesn't work!!!
> please try it it is amazing!!!
Incrementing a number by 0.1 produces numbers, which are not exactly
representable in binary, so this operation involves a rounding error.
Try the following
q=0
for (j in 1:11){
if ((q==1)){
print(q)
}
t;- 1000
n <- 4
a <- matrix(as.character(sample(10, m*n, replace=TRUE)), nrow=m, ncol=n)
system.time(out1 <- duplicatedSort(a))
system.time(out2 <- duplicated(a))
identical(out1, out2)
table(out1)
I obtained, for example,
user system elapsed
0.003 0.000 0.003
in first.occ are those, which are required for the output
of duplicates(), but they are in the order of the sorted "dat". The
last line
first.occ[order(s)]
reorders the vector to the original order of the rows.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
s or index ... ERROR
Re-running with no redirection of stdout/stderr.
Hmm ... looks like a package
You may want to clean up by 'rm -rf /tmp/RtmpQ0WawT/Rd2pdf41481e1'
Is it intentional not to test the presence of pdflatex during R CMD check?
Petr Savicky.
__
to a factor, then back at the very end. Because it is a bigger change
> the potential for breakage is higer, however.
Can you describe the error in more detail? Is it related to consistency
of converting a number to character and back?
Petr Savicky.
__
elative differences in x, but if the mantissa begins with 9, then
a smaller relative difference is sufficient to change 15-th digit.
In terms of unique(), this implies
nrow(unique(cbind(x)))
[1] 2
nrow(unique(cbind(9*x)))
[1] 4
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
on(a)
{
temp <- apply(a, 2, rank, ties.method="max")
temp <- apply(temp, 1, function(x) paste(x, collapse = "\r"))
a[!duplicated(temp), , drop=FALSE]
}
unique.mat(a)
[,1] [,2]
112
312
512
712
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
g rank().
For example,
temp3 <- as.matrix(rank(temp1, ties.method="max"))
match(temp3, unique(temp3))
[1] 1 2 3 4 4 5 6 7 7 7 6 6 6 8 8 8 6 6 6 9 9 9 6 6
Can this be used in your code?
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
On Tue, Feb 22, 2011 at 01:38:07PM +0100, Petr Savicky wrote:
...
> The commands
>
> txt <- readLines(file.path(R.home("doc"), "COPYING"))
> txt.xz <- memCompress(txt, "x")
>
> do not produce an error, if the compiled R runs in the s
t;), "COPYING"))
txt.xz <- memCompress(txt, "x")
do not produce an error, if the compiled R runs in the same shell,
where "make check" was run. However, they produce the error, if R is
started in a new shell.
The command
find /usr -name "liblzma*"
has empty outp
TF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
of the output is formulated there.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
example3 <- c(
1.004999,
1.005001)
for (x in example3) print(x, digits=7)
[1] 1
[1] 1.01
example4 <- c(
9.994999,
9.995001)
for (x in example4) print(x, digits=7)
[1] 9.99
[1] 10
I appr
On Thu, Feb 10, 2011 at 10:37:09PM +1100, Graham Williams wrote:
> Should one expect minor numerical differences between 64bit and 32bit R on
> Windows? Hunting around the lists I've not been able to find a definitive
> answer yet. Seems plausible using different precision arithmetic, but waned
> t
uggestion only and the actual number of printed digits
may be smaller, if the relative error of the output number is
less than 10^-digits. Use 'signif(, digits)' before printing to get
the exact number of the printed significant digits.
I appreciate to know the opinion of R developers on this.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
ounded to a single digit are
(8 - 7.921)/7.921
[1] 0.009973488
(8 - 7.92)/7.92
[1] 0.01010101
In the first case, this is less than 10^-2 and so, l = 1
is used. In the second case, the relative error for l = 1
is larger than 10^-2 an so, l = 2 is chosen.
In the cases
s
interactive. If readline() is not the last line of the code, then
the next line of code is used instead of the user input.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
ice 6
>26
The function devSet() works fine and i will use it. Thank you
very much for this information.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Usually, i use an interval of the device numbers, but sometimes,
it could be useful to open, say, device 4, even if device 3
is not needed. Is there a way, how to open a device with a
given number without opening devices with smaller numbers?
Petr Savicky.
___
on exactly. So, already at the
R level is, actually
formatC(1204.245, digits=20) # [1] "1204.24498909"
See
http://rwiki.sciviews.org/doku.php?id=misc:r_accuracy
or FAQ 7.31 for more examples.
Petr Savicky.
>
> Is there a way to pass the arguments differently?
>
>
ally does
not keep the exact value and performs some rounding. However, conversion
of a double x to character type, which preserves the number exactly, may
be obtained, for example, using
formatC(x, digits=17, width=-1)
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
On Tue, Feb 02, 2010 at 01:37:46PM +0100, Petr Savicky wrote:
> I would like to add some more information concerning the patch C
> to the function choose() proposed in the email
> https://stat.ethz.ch/pipermail/r-devel/2009-December/056177.html
>
> The patch uses transformations
I would like to add some more information concerning the patch C
to the function choose() proposed in the email
https://stat.ethz.ch/pipermail/r-devel/2009-December/056177.html
The patch uses transformations of choose(n, k), which are described in
http://www.cs.cas.cz/~savicky/R-devel
irectory "R-devel/po" at https://svn.r-project.org/R/trunk/,
so the problem could be just temporary.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
umerically equal to an) integer and, e.g., only 'to'
is specified, or also if only 'length' or only 'along.with' is
specified. *Note:* this may change in the future and programmers
should not rely on it.
This sugge
obtained sometimes
from the original implementation and which is more accurate in all ranges of
the output.
For testing patch C a simpler script is sufficient, since we need not to take
care of the warnings. Namely
http://www.cs.cas.cz/~savicky/R-devel/test_choose_1.R
which produces the output (the
ort, which is missing on my computer.
The test was run both with Intel extended and SSE arithmetic.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
from choose() and the intention
of this patch is not to change this. Most of these warnings are eliminated
in the original implementation by treating numbers, which differ from an
integer by less than 1e-7, as integers. However, there are some such cases
even if the difference is slightly larger than 1e
> When you type in the example codes:
>
> > sprintf("%s is %f feet tall\n", "Sven", 7.1)
>
> and R returns:
>
> [1] "Sven is 7.10 feet tall\n"
>
> this is very different from the 'sprintf' function in C/C++, for in C/C++,
> the format string "\n" usually represents a new line, but here, jus
002 1.035
So, the jump in the exactly integer value n[16] == 5 is comparable
to machine accuracy.
I would be pleased to provide more tests, if some of the above solutions
or their modifications can be accepted.
Petr Savicky.
--- R-devel_2009-12-16/src/nmath/choose.c
992673 -3.5992673
[6,] -0.020507812NaN -3.8869494
[7,] 0.016113281 -4.1281114 -4.1281114
[8,] -0.013092041 NaN -4.3357508
[9,] 0.010910034 -4.5180723 -4.5180723
[10,] -0.009273529NaN -4.6805913
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
igits=4) # [1] 0.9131
I do not know the history of the R printing algorithm. It is designed
primarily for printing vectors, where the rules are more complicated
to achieve a good unified format for all numbers. May be, someone else
can say more about it. The above analysis may b
igits=4) # [1] 0.9131
I do not know the history of the R printing algorithm. It is designed
primarily for printing vectors, where the rules are more complicated
to achieve a good unified format for all numbers. May be, someone else
can say more about it. The above analysis may b
e
current R-devel and run "make" and "make check" (both OK) and compared
the output of
R CMD check XML_2.6-0.tar.gz
R CMD check randomForest_4.5-33.tar.gz
R CMD check tree_1.0-27.tar.gz
R CMD check survival_2.35-7.tar.gz
with R being both original R-devel and the modified on
For the package at
http://www.cs.cas.cz/~savicky/R-devel/something_0.0.0.tar.gz
which is a minor part of some other package only to demonstrate the
problem, i get (under R version 2.11.0 Under development 2009-12-12 r50714
and also under R-2.9.2, openSUSE 11.1 (x86_64) and CentOS release 5.2
On Mon, Nov 30, 2009 at 04:00:12AM +0100, dsim...@gmail.com wrote:
> > a <- c(1:10)
> > b <- c(1:10)
> > cor.test(a, b, method = "spearman", alternative = "greater", exact = TRUE)
>
> Spearman's rank correlation rho
>
> data: a and b
> S = 0, p-value < 2.2e-16
> alternative hypothesis:
So, we have
formatC(V[7], digits=20) # [1] "0.60008882"
formatC(0.6, digits=20) # [1] "0.5999778"
See
http://wiki.r-project.org/rwiki/doku.php?id=misc:r_accuracy
for more examples and explanations.
Petr Savicky.
> V[8]
> # [1] 0.7
> V[8
On Sat, Aug 22, 2009 at 12:00:44AM +0200, Martin Maechler wrote:
> I have taken up the issue now,
> and after thinking, studying the source, trying to define a
> 'method = ' argument, came to the conclusion that both
> the implementation and documentation (and source code "self-explanation")
> are
r message in a private email (as was also
the email you were replying to).
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
On Wed, Aug 12, 2009 at 04:02:28PM +0200, Martin Maechler wrote:
> >>>>> "PS" == Petr Savicky
> >>>>> on Wed, 12 Aug 2009 13:50:46 +0200 writes:
>
> PS> Let me add the following to the discussion of identical(0, -0).
> PS>
Let me add the following to the discussion of identical(0, -0).
I would like to suggest to replace the paragraph
'identical' sees 'NaN' as different from 'NA_real_', but all
'NaN's are equal (and all 'NA' of the same type are equal).
in ?identical by the following text, which is a correction
On Tue, Aug 11, 2009 at 10:04:20AM +0200, Martin Maechler wrote:
> > "DM" == Duncan Murdoch
> > on Mon, 10 Aug 2009 11:51:53 -0400 writes:
>
> DM> For people who want to play with these, here are some functions that
> let
> DM> you get or set the "payload" value in a NaN. N
On Mon, Aug 10, 2009 at 05:47:57AM -0400, Duncan Murdoch wrote:
> I wouldn't mind a "strict" option. It would compare bit patterns, so
> would distinguish +0 from -0, and different NaN values.
I think that a logical option "strict" in the above meaning could be
useful for debugging. The default
On Sat, Aug 08, 2009 at 10:39:04AM -0400, Prof. John C Nash wrote:
> I'll save space and not include previous messages.
>
> My 2 cents: At the very least the documentation needs a fix. If it is
> easy to do, then Ted Harding's suggestion of a switch (default OFF) to
> check for sign difference w
On Tue, Aug 04, 2009 at 04:25:09PM +0200, lueth...@student.ethz.ch wrote:
> Hi
>
> I created the following vectors:
>
> p_1=c(0.2,0.2,0.2,0.2,0.1,0.25,0.4,0.1,0.25,0.4,0.1,0.25,0.4,0.1,0.25,0.4,0.2,0.5,0.8,0.2,0.5,0.8,0.2,0.5,0.8,0.2,0.5,0.8)
> p_2=c(0,0,0,0,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.
> I get an incorrect result for
>
> (41/10-1/10)%%1
>
> [1] 1
Note that due to rounding errors, 41/10-1/10 is
formatC(41/10-1/10, digits=20) # [1] "3.9995559"
Besides FAQ 7.31, related information may be found also at
http://wiki.r-project.org/rwiki/doku.php?id=misc:r_accuracy
On Fri, Jul 03, 2009 at 07:57:49AM -0700, Martin Morgan wrote:
[...]
> sort.list is always called but used only to determine the order of
> levels, so unnecessary when levels are provided.
I think, this is correct. Replacing
ind <- sort.list(x)
by
if (missing(levels))
ind <- sort.list(x
I am sorry for not including the attachment mentioned in my
previous email. Attached now. Petr.
--- R-devel/src/library/utils/R/readtable.R 2009-05-18 17:53:08.0
+0200
+++ R-devel-readtable/src/library/utils/R/readtable.R 2009-06-25
10:20:06.0 +0200
@@ -143,9 +143,6 @@
On Sun, Jun 14, 2009 at 02:56:01PM -0400, Gabor Grothendieck wrote:
> If read.csv's colClasses= argument is NOT used then read.csv accepts
> double quoted numerics:
>
> 1: > read.csv(stdin())
> 0: A,B
> 1: "1",1
> 2: "2",2
> 3:
> A B
> 1 1 1
> 2 2 2
>
> However, if colClasses is used then it se
On Sun, Jun 14, 2009 at 09:21:24PM +0100, Ted Harding wrote:
> On 14-Jun-09 18:56:01, Gabor Grothendieck wrote:
> > If read.csv's colClasses= argument is NOT used then read.csv accepts
> > double quoted numerics:
> >
> > 1: > read.csv(stdin())
> > 0: A,B
> > 1: "1",1
> > 2: "2",2
> > 3:
> > A B
On Sat, May 30, 2009 at 07:32:52PM +0200, Martin Maechler wrote:
> > "vQ" == Wacek Kusnierczyk
> > on Sat, 30 May 2009 11:16:43 +0200 writes:
[...]
> vQ> one simple way to improve the code is as follows; instead of
> (simplified)
>
> vQ> const char* dropTrailing(const char
On Fri, May 29, 2009 at 03:53:02PM +0200, Martin Maechler wrote:
> my version of *using* the function was
>
> 1 SEXP attribute_hidden StringFromReal(double x, int *warn)
> 2 {
> 3 int w, d, e;
> 4 formatReal(&x, 1, &w, &d, &e, 0);
> 5 if (ISNA(x)) return NA_STRING;
> 6 else return mkChar(d
On Wed, May 27, 2009 at 10:51:38PM +0200, Martin Maechler wrote:
> I have very slightly modified the changes (to get rid of -Wall
> warnings) and also exported the function as Rf_dropTrailing0(),
> and tested the result with 'make check-all' .
Thank you very much for considering the patch. -Wall
On Mon, May 25, 2009 at 03:58:06PM +0800, Berwin A Turlach wrote:
> Well, the first statement is a remark on comparison in general while
> the second statement is specific to "comparison operators and generic
> methods". There are other ways of comparing objects; note:
>
> R> f1 <- factor(c("a",
In the almost current development version (2009-05-22 r48594) and also in
https://svn.r-project.org/R/trunk/src/library/base/man/factor.Rd
?factor contains (compare the formulations marked by ^^)
\section{Warning}{
The interpretation of a factor depends on both the codes and the
\code{"
On Wed, May 20, 2009 at 11:10:11PM +0200, wolfgang.re...@gmail.com wrote:
...
> Strange behavior of qbinom:
>
> > qbinom(0.01, 5016279, 1e-07)
> [1] 0
> > qbinom(0.01, 5016279, 2e-07)
> [1] 16
> > qbinom(0.01, 5016279, 3e-07)
> [1] 16
> > qbinom(0.01, 5016279, 4e-07)
> [1] 16
> > qbinom(0.01, 5016
Function factor() in the current development version (2009-05-22)
guarantees that levels are different character strings. However, they
may represent the same decimal number. The following example is derived
from a posting by Stavros Macrakis in thread "Match .3 in a sequence"
in March
nums <- 0
Bug report "Spearman's rank correlation test (PR#13574)" was moved
to trashcan with empty Notes field. I would like to learn, what was wrong
with this bug report. Can i ask the developers to add a note to it?
Thank you in advance.
Petr.
__
R-devel@r-pr
On Wed, May 13, 2009 at 02:35:12PM +0200, gos...@igmm.cnrs.fr wrote:
> I cannot explain why R seems to have problems adding two big numbers.
>
> sprintf("%f",10^4+10^19) gives "10010240.00"
> instead of "1001.00"
>
> problems seems to arriv
On Mon, May 11, 2009 at 05:06:38PM +0200, Martin Maechler wrote:
> The version I have committed a few hours ago is indeed a much
> re-simplified version, using as.character(.) explicitly
The current development version (2009-05-11 r48528) contains
in ?factor a description of levels parametr
le
On Mon, May 11, 2009 at 05:06:38PM +0200, Martin Maechler wrote:
[...]
> The version I have committed a few hours ago is indeed a much
> re-simplified version, using as.character(.) explicitly
> and consequently no longer providing the extra optional
> arguments that we have had for a couple of da
On Sat, May 09, 2009 at 10:55:17PM +0200, Martin Maechler wrote:
[...]
> If'd revert to such a solution,
> we'd have to get back to Peter's point about the issue that
> he'd think table(.) should be more tolerant than as.character()
> about "almost equality".
> For compatibility reasons, we could
On Fri, May 08, 2009 at 06:48:40PM +0200, Martin Maechler wrote:
> >>>>> "PS" == Petr Savicky
> >>>>> on Fri, 8 May 2009 18:10:56 +0200 writes:
[...]
> PS> ... I have
> PS> strong objections against the existing implementatio
On Fri, May 08, 2009 at 05:14:48PM +0200, Petr Savicky wrote:
> Let me suggest to consider the following modification, where match() is done
> on the strings, not on the original values.
> levels <- unique(as.character(sort(unique(x
> x <- as.character(x)
> f &l
On Fri, May 08, 2009 at 03:18:01PM +0200, Martin Maechler wrote:
> As long as we don't want to allow factor() to fail --rarely --
> I think (and that actually has been a recurring daunting thought
> for quite a few days) that we probably need an
> extra step of checking for duplicate levels, and
On Wed, May 06, 2009 at 10:41:58AM +0200, Martin Maechler wrote:
> PD> I think that the real issue is that we actually do want almost-equal
> PD> numbers to be folded together.
>
> yes, this now (revision 48469) will happen by default, using signif(x, 15)
> where '15' is the default f
On Wed, May 06, 2009 at 10:41:58AM +0200, Martin Maechler wrote:
> PD> I think that the real issue is that we actually do want almost-equal
> PD> numbers to be folded together.
>
> yes, this now (revision 48469) will happen by default, using signif(x, 15)
> where '15' is the default f
On Tue, May 05, 2009 at 11:27:36AM +0200, Peter Dalgaard wrote:
> I know. The point was rather that if you are not careful with rounding,
> you get the some of the bars wrong (you get 2 or 3 small bars very close
> to each other instead of one longer one). Computed p values from
> permutation tests
On Mon, May 04, 2009 at 07:28:06PM +0200, Peter Dalgaard wrote:
> Petr Savicky wrote:
> > For this, we get
> >
> > > convert(0.3)
> > [1] "0.3"
> > > convert(1/3)
> > [1] "0." # 16 digits suf
On Mon, May 04, 2009 at 05:39:52PM +0200, Martin Maechler wrote:
[snip]
> Let me quickly expand the tasks we have wanted to address, when
> I started changing factor() for R-devel.
>
> 1) R-core had unanimously decided that R 2.10.0 should not allow
>duplicated levels in factors anymore.
>
>
In R-2.10.0, the development version, function as.factor() uses 17 digit
precision for conversion of numeric values to character type. This
is very good for the consistency of the resulting factor, however,
i expect that people will complain about, for example, as.factor(0.3)
being
[1] 0.2999
On Thu, Apr 23, 2009 at 11:37:37AM +0200, Martin Maechler wrote:
[snip]
> TP> To test whether a value is an integer value, you can so something
> like this:
>
> >> is.wholenumber <- function(x, tolerance = .Machine$double.eps^0.5)
> TP> return(abs(x - round(x)) < tolerance)
> >>
On Wed, Apr 22, 2009 at 04:30:36PM -0400, Stavros Macrakis wrote:
[snip]
> Now consider 1e40, which has the property
> that floor(x)==x==ceiling(x), which you might think characterizes an
> integer; but it also has the property that x+1 == x. Similarly for
> 1/3 * 1e40.
[snip]
The number 1/3 * 1
On Tue, Mar 24, 2009 at 07:41:31AM -0700, Ulrike Grömping wrote:
> > Probably, k is needed also later. Assumig that 2^k works correctly,
> > the following could be sufficient
> >
> >if (!is.null(nruns)){
> > k <- round(log2(nruns))
> > if (!2^k==nruns) stop("nruns must be a power o
On Tue, Mar 24, 2009 at 02:45:57PM +0100, Uwe Ligges wrote:
> >gives the custom error message "nruns must be a power of 2.", which is
> >generated in the first check within function FrF2:
> >
> >if (!is.null(nruns)){
> > k <- floor(log2(nruns))
> > if (!2^k==nruns) stop("nruns must
On Tue, Mar 17, 2009 at 10:04:39AM -0400, Stavros Macrakis wrote:
...
> 1) Factor allows repeated levels, e.g. factor(c(1),c(1,1,1)), with no
> warning or error.
Yes, this is a confusing behavior, since repeated levels are never meaningful.
> 2) Even from distinct inputs, factor of a numeric vect
On Tue, Mar 17, 2009 at 10:15:39AM +0100, Wacek Kusnierczyk wrote:
...
> there's one more curiosity about factors, in particular, ordered factors:
>
> ord <- as.ordered(nums); ord
> # [1] 0.300 0.3 0.3
> 0.300
> # Levels: 0.30
On Mon, Mar 16, 2009 at 07:39:23PM -0400, Stavros Macrakis wrote:
...
> Let's look at the extraordinarily poor behavior I was mentioning. Consider:
>
> nums <- (.3 + 2e-16 * c(-2,-1,1,2)); nums
> [1] 0.3 0.3 0.3 0.3
>
> Though they all print as .3 with the default precision (which is
> normal and
On Mon, Mar 16, 2009 at 06:36:53AM -0700, Daniel Murphy wrote:
> Hello:I am trying to match the value 0.3 in the sequence seq(.2,.3). I get
> > 0.3 %in% seq(from=.2,to=.3)
> [1] FALSE
As others already pointed out, you should use seq(from=0.2,to=0.3,by=0.1)
to get 0.3 in the sequence. In order to
Full_Name: Petr Savicky
Version: 2.7.2, 2.8.1, 2.9.0
OS: Linux
Submission from: (NULL) (147.231.6.9)
The p-value of Spearman's rank correlation test is calculated in
cor.test(x, y, method="spearman")
using algorithm AS 89. However, the way how AS 89 is used incures error,
which
> > seq(0,1,0.1)==0.4
> [1] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
> > seq(0,1,0.1)==0.6
> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> > seq(0,1,0.1)==0.8
> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
>
> What is w
Hi All:
help(cor.test) claims
For Spearman's test, p-values are computed using algorithm AS 89.
Algorithm AS 89 was introduced by the paper
D. J. Best & D. E. Roberts (1975), Algorithm AS 89: The Upper Tail
Probabilities of Spearman's rho. Applied Statistics, Vol. 24, No. 3, 377-379.
Table
Hi All:
The p-value of Spearman's rank correlation test is calculated using algorithm
AS 89. However, the way how AS 89 is used incures error, which may be an order
of magnitude larger than the error of the original algorithm.
In case of no ties AS 89 expects an even value of the statistic
S =
Dear R developers:
There is a possible bug in calculating the p-value
for Spearman's rank correlation.
Line 155 in file
R-patched/src/library/stats/R/cor.test.R
is
as.double(round(q) + lower.tail),
I think, it should be
as.double(round(q) + 2*lower.tail),
The reason is that round(q)
Full_Name: Petr Savicky
Version: all versions starting from 1.7.0
OS: observed on Linux, but is platform independent
Submission from: (NULL) (62.24.91.47)
The function runif(n) contains a protection against the zero state of
Mersenne Twister stored in .Random.seed. If the state is zero, it is
nd the patch to R-devel, if the proposed
solution is of the sort, which could be considered.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
mp; 0x8000) != 0);
+ if(!notallzero)
+ for (j = 2; j <= 624; j++)
if(RNG_Table[RNG_kind].i_seed[j] != 0) {
notallzero = 1;
break;
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
5
[3,] 2147483646.0 2147483646 2147483646
[4,] 2147483646.5 2147483646 2147483646
[5,] 2147483647.0 2147483647 2147483647
[6,] 2147483647.5 2147483647 2147483647
[7,] 2147483648.0 NA NA
Petr Savicky.
__
R-devel@r-project.o
rol of duplication could help.
The tools may be, for example, some function, which allows a simple
query to the NAMED status of a given object on R level and
modifying some of the built-in functions to be more careful with
NAMED attribute. A possible strengthening of gc() would, of course, be
very useful here. I think about an explicit use of it, not about
the automatical runs. So, for safety reasons, the "NAMED reduction"
could be done by a different function, not the default gc() itself.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
n NAMED may be dropped from 2 to 1? How much would this increase
the complexity of gc()?
Thank you in advance for your kind reply.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
a <- matrix(1:6,nrow=2)
nrow(a,a) # Error in nrow(a, a) : unused argument(s) (1:6)
dim(a,a) # Error: 2 arguments passed to 'dim' which requires 1
May be, also other solutions exist.
Petr Savicky.
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
1 - 100 of 136 matches
Mail list logo