Displaying 20 results from an estimated 20000 matches similar to: "rexp, different results on 32/64 bit"
2012 Jul 26
2
coxph weirdness
Hi all,
I cant' wrap my head around an error from the coxph function (package
survival). Here's an example:
library(survival)
n = 100;
set.seed(1);
time = rexp(n);
event = sample(c(0,1), n, replace = TRUE)
covar = data.frame(z = rnorm(n));
model = coxph(Surv(time, event)~ . , data = covar)
R gives the following error:
> model = coxph(Surv(time, event)~ . , data = covar)
Error in
2014 Nov 22
3
R string comparisons may vary with platform (plain text)
A colleague?s R program behaved differently when I ran it, and we thought
we traced it probably to different results from string comparisons as
below, with different R versions. However the platforms also differed. A
friend ran it on a few machines and found that the comparison behavior
didn?t correlate with R version, but rather with platform.
I wonder if you?ve seen this. If it?s not some
2016 Jan 08
5
rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7
Hello,
As an example, I ran the following code:
library("rgl")
example(plot3d)
rgl.snapshot("test.png")
The full plot is visible in the window titled RGL device 1 [Focus], but only a small
2016 Jan 08
5
rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7
Hello,
As an example, I ran the following code:
library("rgl")
example(plot3d)
rgl.snapshot("test.png")
The full plot is visible in the window titled RGL device 1 [Focus], but only a small
2010 May 17
2
Dynamically build variable names
I'm trying to dynamically build variable names to use on a list. Let's say I have a list like this one:
l <- list(V1_1=c(1,2,3), V1_2=c('One','Two','Three'))
And I succesfully build my variable name like this:
paste('l$', 'V1_1', sep='')
Why can't I just run a mean call with the pasted variable name?
mean(paste('l$',
2015 Aug 13
2
Bug in rank with utf8?
Yes, collation is a strange thing, and?
Collation order will depend on locale settings, and there are quite a few cases where the collation order of two items is not defined.
To add to the confusion, on OSX Mavericks, I see
> x <- "\u0663"
> y <- 3
>
> x == y
[1] FALSE
> rank(c(x, y))
[1] 2 1
> x
[1] "?"
> x == y
[1] FALSE
> x > y
[1] TRUE
2010 May 26
2
segfault on 2.11.0 with large POSIXct vector using as.character
Running "as.character" on a large POSIXct causes a segfault on my 2.11
(2010-04-22) install. Seems to crash at around 9e4 ... on OSX and Ubuntu at
least.
> invisible(as.character(Sys.time()+1:7e4))
> invisible(as.character(Sys.time()+1:8e4))
> invisible(as.character(Sys.time()+1:9e4))
Error: segfault from C stack overflow
> invisible(as.character(Sys.time()+1:5e5))
Error:
2011 Sep 15
2
Unexpected behavior from which.max (or possibly max)
Hi all,
I was recently writing a script to identify the value and id of the maximum
observation in a sliding window when I ran into some unexpected behavior. I
have included an example.
> test <- c()
> test$elev <- c(1:200)
> test$i <- 1
> test$window <- 10
The following works for me:
> check.max <- function(x){obs.max <- x$elev[x$i:x$i+x$window]; obs.max}
2011 Apr 10
1
deparse operators in expressions
Hi,
I observed a slight problem in deparse(): it will add spaces around
most operators except /. I wonder if this is easy to fix. I know this
is quite trivial, but I will appreciate if / is not treated as an
exception. Examples:
> deparse(expression(1/1))
[1] "expression(1/1)"
> deparse(expression(1+1))
[1] "expression(1 + 1)"
> deparse(expression(1%in%1))
[1]
2010 Jul 14
2
qplot in ggplot2 not working any longer - (what did I do?)
This is the first time that I have tried to update packages with a
tinkered around with .Rprofile. I start R with R --vanilla and it
does not load my .Rprofile, but when I issue the command
update.packages() R downloads the packages as expected, but then seems
to load .Rprofile before compiling the packages sources. What am I
doing wrong?
kindest regards,
Stephen Sefick
see- Session info
2010 Oct 28
2
scatterplot3d; scaling point symbols to depth of graph
Hi
I'm trying to scale the point symbols on a 3d plot so that the ones at the front are larger than the ones at the back. I'm trying to give the image some perspective.
Given this code...
library(scatterplot3d)
data=array(c(0,5,9), c(3,3))
scatterplot3d(data, pch=19, cex.symbols=10-data[,2], color=c("red","blue","black"));
> data
[,1] [,2] [,3]
2011 Aug 29
1
Out-of-date manual or small bug in R CMD check?
Hey all,
I get a warning about an unsupported file type in the data directory during
R CMD check (for R 2.13.1) if I use the save function to create an Rdata,
but if I save the same object to a .rda file, no warning.
Section 1.1.5 (pg 11 of the pdf) of the Writing R Extensions manual (2.13.1)
appears to say that .Rdata files should be fine:
" Data files can have one of three types as
2011 Feb 07
2
Error with named chunks in Sweave with the development version of R
Dear all,
There seems to be a problem with named chunks in Sweave with the version
of R under development (downloaded yesterday). When I sweave the file
toto.Rnw described at the end of this mail (Ubuntu 10.04 LTS), the
function Sweave returns an Internal error:
> utils::Sweave("toto.Rnw")
Writing to file toto.tex
Processing code chunks ...
1 : echo term verbatim (label=a)
2
2010 Jun 16
2
Backslash in paste() function
Hi,
I'm trying to build a vector of latex commands. However, I need the command strings to begin with a backslash "\". I have:
test <- c('foo','bar')
and I need to rebuild the array, encapsulating the text items with latex stuff, like this:
paste("\parbox[b]{3cm}{", test, "}", fill=TRUE)
Actually, cat() prints the string fine if one uses
2011 Jul 30
1
read.table only reads part of file
Hi all,
I encountered a problem when trying to read in an Illumina chip
annotation file. The offending file is large, so I zipped it up and
posted it at
http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/tmp/ProbeInfo_Expression.txt.bz2
Executing this:
annot = read.table(bzfile("ProbeInfo_Expression.txt.bz2"),
comment.char="", sep =
2011 Apr 01
3
Syntax coloring in R console
Dear all,
I am a happy user of R console, but I would like to see syntax
coloring. I use R 2.12 in Ubuntu Linux.
I have found the packages "xterm256" and "highlight", but I was not
able to figure out how to use it to highlight the syntax in console
output.
Also, I tried several GUI interfaces, but I was not able to find
something that suits me better than the default R
2010 Sep 01
1
Looks like a bug in subsetting of a complicated object
I don't understand what is happening! I have a (large) object sim1, an
matrix list
with dim c(101,101) where each element is an 3*3 matrix. I am
subsetting that with
a matrix coo, of dim c(100,2), of unique indices, but the resulting object
has length 99, not 100 as expected.
Code reproducing the problem follows:
library(RandomFields)
set.seed(123)
sim0 <- GaussRF(x=seq(0, 100, by=1),
2014 Nov 23
2
R string comparisons may vary with platform (plain text)
On Sat, Nov 22, 2014 at 12:42 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 22/11/2014, 2:59 PM, Stuart Ambler wrote:
>> A colleague?s R program behaved differently when I ran it, and we thought
>> we traced it probably to different results from string comparisons as
>> below, with different R versions. However the platforms also differed. A
>>
2011 Feb 23
1
factor() on a double vector
Hi,
When 'x' is a vector of doubles, it's not clear how 'factor(x)'
compares its values in order to determine the levels. For example,
here all the values in 'x' are "conceptually" the same:
x <- c(11/3,
2/3 + 4/3 + 5/3,
50 + 11/3 - 50,
7.00001 - 1000003/300000)
However, due to machine rounding errors, they are not
2011 Mar 05
1
file mode lost in file.copy()?
Hi,
Recently I noticed file.copy() would discard the file mode
information. Is this the expected behaviour or a bug for file.copy()?
> file.create('testfile')
[1] TRUE
> file.info('testfile')
size isdir mode mtime ctime
testfile 0 FALSE 644 2011-03-05 17:06:39 2011-03-05 17:06:39
atime uid gid uname grname