Displaying 20 results from an estimated 20000 matches similar to: "'rbind' in example(make.unique)"
2013 Jan 28
1
Suggestions for 'diff.default'
I have suggestions for function 'diff.default' in R.
Suggestion 1: If the input is matrix, always return matrix, even if empty.
What happens in R 2.15.2:
> rbind(1:2) # matrix
[,1] [,2]
[1,] 1 2
> diff(rbind(1:2)) # not matrix
integer(0)
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United
2013 Feb 01
1
Was confused with options(error = expression(NULL)) in example(stop)
In example for function 'stop' in R, there is
options(error = expression(NULL))
with comment
# don't stop on stop(.) << Use with CARE! >>
I was interested, wanted to know how "don't stop on stop(.)" was. So, I tried it.
Typing
example(stop)
at the R prompt and pressing ENTER give this.
> example(stop)
stop> options(error = expression(NULL))
2012 Dec 06
2
factor(x, exclude=y) if x is a factor
I found this part in the documentation of 'factor'.
'factor(x, exclude=NULL)' applied to a factor is a no-operation
unless there are unused levels: in that case, a factor with the
reduced level set is returned. If 'exclude' is used it should
also be a factor with the same level set as 'x' or a set of codes
for the levels to be excluded.
2013 Jun 18
1
install a package made using bioconductor package pdInfoBuilder
Dear maintainer,
I used bioconductor package, pdInfoBuilder, to make a microarray platform annotation package.
I named this package, pd.pdinfo.gpl11164.ndf.txt. This "self-made package" is to be used with oligo package.
Prior to using oligo package, I need to install the annotation package, pd.pdinfo.gpl11164.ndf.txt, and cannot just copy it to the library tree.
I tried using the
2018 Apr 29
2
Result of 'seq' doesn't use compact internal representation
> .Internal(inspect(1:10))
@300e4e8 13 INTSXP g0c0 [NAM(3)] 1 : 10 (compact)
> .Internal(inspect(seq(1,10)))
@3b6e1f8 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
> system.time(1:1e7)
user system elapsed
0 0 0
> system.time(seq(1,1e7))
user system elapsed
0.05 0.00 0.04
It seems that result of function 'seq' doesn't use compact
2018 Apr 29
1
Result of 'seq' doesn't use compact internal representation
Thanks -- I'll commit a fix after some testing.
Best,
luke
On 04/29/2018 06:22 AM, Duncan Murdoch wrote:
> On 28/04/2018 11:11 PM, Suharto Anggono Suharto Anggono via R-devel wrote:
>>> .Internal(inspect(1:10))
>> @300e4e8 13 INTSXP g0c0 [NAM(3)]? 1 : 10 (compact)
>>> .Internal(inspect(seq(1,10)))
>> @3b6e1f8 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
2013 Apr 30
3
Subset of a 'table' divided by a 'table' is a 'table', but printed by 'print.default'
This is just info.
I recently got something like this.
> x <- factor(c("A","A","B","B"), levels=c("A","B"))
> y <- factor(c("a","b","a","b"), levels=c("a","b"))
> table(x, y)[, "a"] / table(x)
x
A B
0.5 0.5
attr(,"class")
[1]
2016 May 30
1
factor(x, exclude=NULL) for factor x; names in as.factor(<integer>)
In R 3.3.0 (also in R 2.7.2), the documentation on 'factor', in "Details" section, has this statement.
'factor(x, exclude = NULL)' applied to a factor is a no-operation unless there are unused levels: in that case, a factor with the reduced level set is returned.
It is not true for a factor 'x' that has NA. In that case, if levels of 'x' doesn't
2010 Jul 08
2
strsplit("dia ma", "\\b") splits characterwise
\b is word boundary.
But, unexpectedly, strsplit("dia ma", "\\b") splits character by character.
> strsplit("dia ma", "\\b")
[[1]]
[1] "d" "i" "a" " " "m" "a"
> strsplit("dia ma", "\\b", perl=TRUE)
[[1]]
[1] "d" "i" "a" " "
2018 Apr 29
0
Result of 'seq' doesn't use compact internal representation
On 28/04/2018 11:11 PM, Suharto Anggono Suharto Anggono via R-devel wrote:
>> .Internal(inspect(1:10))
> @300e4e8 13 INTSXP g0c0 [NAM(3)] 1 : 10 (compact)
>> .Internal(inspect(seq(1,10)))
> @3b6e1f8 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
>> system.time(1:1e7)
> user system elapsed
> 0 0 0
>> system.time(seq(1,1e7))
> user
2016 Jun 03
0
complex NA's match(), etc: not back-compatible change proposal
With 'z' of length 8 below, or of length 12 previously, one may try
sapply(rev(z), match, table = rev(z))
match(rev(z), rev(z))
I found that the two results were different in R devel r70604.
A shorter one:
> z <- complex(real = c(0,NaN,NaN), imaginary = c(NA,NA,0))
> sapply(z, match, table = z)
[1] 1 1 2
> match(z, z)
[1] 1 1 3
An explanation of the behavior: With normal
2008 Nov 16
1
inconsistency between timeSeries and zoo causing a problem with rbind
Dear R Users and maintainers of packages zoo and timeSeries,
I believe there is a recently introduced inconsistency between
timeSeries and zoo which is causing a problem with rbind. I had
previously reported that I was having problems with rbind in the
following code:
library(zoo)
foo<-zoo(1,order.by=as.Date("2007-10-09"))
bar<-zoo(2,order.by=as.Date("2007-10-10"))
2016 May 28
1
complex NA's match(), etc: not back-compatible change proposal
On 'factor', I meant the case where 'levels' is not specified, where 'unique' is called.
> factor(c(complex(real=NaN), complex(imaginary=NaN)))
[1] NaN+0i <NA>
Levels: NaN+0i
Look at <NA> in the result above. Yes, it happens in earlier versions of R, too.
On matching both NA and NaN, another consequence is that length(unique(.)) may depend on order.
2016 May 13
1
complex NA's match(), etc: not back-compatible change proposal
That, for example, complex(real=NaN) and complex(imaginary=NaN) are regarded as equal makes it possible that length(unique(as.character(x))) > length(unique(x)) (current code of function 'factor' doesn't expect it). Yes, an argument for the behavior is that NA and NaN are of one kind.
On my system, using 32-bit R for Windows from binary from CRAN, the result of sapply(z, match,
2018 Apr 25
1
Can't Get Lattice Histogram Minor Tick Marks to Work
Thanks Jeff,
I attached a file with the program to my earlier email because the posting guide seemed to imply that non-binary attachments would work. But I see that the file was stripped off.
I installed the program file on a web site, but when I downloaded it, the line breaks were stripped out. So I've included the program below:
-------------------------------------------------------
#
2012 Sep 03
1
Typo (?) in 'aggregate.formula'
In the code for 'aggregate.formula', there is
if (as.character(formula[[2L]] == "."))
I believe that it is meant to be
if (as.character(formula[[2L]]) == ".")
However,
if (as.character(formula[[2L]] == "."))
gives the expected result.
Tracing:
- formula[[2L]] == "."
is equivalent to
as.character(formula[[2L]]) == "."
From the help page for
2012 Nov 07
0
rJava not loading on Windows
Hi,
I've successfully used it on a Linux setup, but when I try to load
rJava on Windows 7 64-bit (session info below) I get:
% R --vanilla
> library("rJava")
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dirname(this$RuntimeLib)
error: a character vector argument expected
Error: package/namespace load failed for 'rJava'
>
2013 Sep 16
1
Patch: fix segfault from empty raster
Hi,
A colleague recently came across an R crash, which I can boil down to
the following, running under Rgui on Windows 7:
library(ggplot2)
ggplot(data.frame(x=1, y=1, z=4.7), aes(x, y, z=z)) + stat_summary2d()
This reliably causes a segmentation fault. sessionInfo() below.
What's happening is that (for reasons which I'll discuss with the
ggplot2 developers) the 'colorbar'
2016 Jul 28
0
Creating shared object with BASE in EXPORTS on Windows
I am building shared objects on Windows system with BASE as a name in
the shared object. When BASE appears under EXPORTS in tmp.def file, R
CMD SHLIB doesn't succeed. This happens on Windows but not Mac or
Ubuntu.
Minimal examples:
////////////////////////////////////////
This code builds fine
////////////////////////////////////////
void base(int *nin, double *x) {
int n = nin[0];
int
2013 Jun 27
1
'modifyList' drops (not adds) NULL components
Dear list,
Utils::modifyList() drops NULL components in its second argument, instead of adding them to the first argument. Compare:
> modifyList(x=list(A=1), val=list(B=2, C=3))
$A
[1] 1
$B
[1] 2
$C
[1] 3
> modifyList(x=list(A=1), val=list(B=NULL, C=3))
$A
[1] 1
$C
[1] 3
To me this seems inconsistent with the documentation ("Elements in 'val' which are missing from