similar to: R Language Definition: Subsetting matrices with negative indices is *not* an error

Displaying 20 results from an estimated 30000 matches similar to: "R Language Definition: Subsetting matrices with negative indices is *not* an error"

2015 May 09
2
R Language Definition: Subsetting matrices with negative indices is *not* an error
On Sat, May 9, 2015 at 12:55 AM, peter dalgaard <pdalgd at gmail.com> wrote: > >> On 09 May 2015, at 02:53 , Henrik Bengtsson <henrik.bengtsson at ucsf.edu> wrote: >> >> Hi, >> >> I spotted what looks like another(*) mistake in 'R Language >> Definition' on how subsetting should work. In Section 'Indexing >> matrices and
2015 May 09
0
R Language Definition: Subsetting matrices with negative indices is *not* an error
> On 09 May 2015, at 02:53 , Henrik Bengtsson <henrik.bengtsson at ucsf.edu> wrote: > > Hi, > > I spotted what looks like another(*) mistake in 'R Language > Definition' on how subsetting should work. In Section 'Indexing > matrices and arrays' > [http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Indexing-matrices-and-arrays] > one can
2015 May 04
4
Shouldn't vector indexing with negative out-of-range index give an error?
In Section 'Indexing by vectors' of 'R Language Definition' (http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Indexing-by-vectors) it says: "Integer. All elements of i must have the same sign. If they are positive, the elements of x with those index numbers are selected. If i contains negative elements, all elements except those indicated are selected. If i is
2015 May 06
1
Shouldn't vector indexing with negative out-of-range index give an error?
On Wed, May 6, 2015 at 1:33 AM, Martin Maechler <maechler at lynne.stat.math.ethz.ch> wrote: >>>>>> John Chambers <jmc at stat.stanford.edu> >>>>>> on Tue, 5 May 2015 08:39:46 -0700 writes: > > > When someone suggests that we "might have had a reason" for some peculiarity in the original S, my usual reaction is "Or
2015 Sep 20
2
Long vectors: Missing values and R_xlen_t?
Is there a missing value constant defined for R_xlen_t, cf. NA_INTEGER (== R_NaInt == INT_MIN) for int(eger)? If not, is it correct to assume that missing values should be taken care/tested for before coercing from int or double? Thank you, Henrik
2015 Aug 14
3
capture.output() duplicates last line unless newline (R-devel bug)
In R-devel (2015-08-12 r69024), capture.output() incorrectly duplicates the last line unless it ends with a newline. I don't see this in R 3.2.2 RC (2015-08-13 r69049). It seems to have started fairily recently; I spotted this yesterday after starting to get errors in my R.utils check that use capture.output(), cf.
2015 Aug 15
1
Why not pthreads on Windows in 'parallel' package?
Aaaah ... and argh - I should have better not to post R question at midnight, especially when I know it forks the process and it's not using threads. Brain meltdown. (So, we'll proceed trying to use pthreads in matrixStats also for Windows). Sorry for the noise and thanks Kasper. Henrik On Aug 15, 2015 02:52, "Kasper Daniel Hansen" <kasperdanielhansen at gmail.com> wrote:
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
I'm observing that base::sum(x, na.rm=FALSE) for typeof(x) == "double" is much more time consuming when there are missing values versus when there are not. I'm observing this on both Window and Linux, but it's quite surprising to me. Currently, my main suspect is settings in on how R was built. The second suspect is my brain. I hope that someone can clarify the below
2015 Aug 14
2
Why not pthreads on Windows in 'parallel' package?
On Windows there are a few 'pthreads' implementation, e.g. pthreads-w32 and winpthreads [https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-pthreads]. We're thinking of giving them a try for the matrixStats package, and basic tests indicates it works, but since Windows pthreads are not used by core R (or?) I've got a little bit worried that we will face overwhelming
2015 May 13
1
Why is the diag function so slow (for extraction)?
As kindly pointed out to me (oh my decaying gray matter), is.object() is better suited for this test; $ svn diff src/library/base/R/diag.R Index: src/library/base/R/diag.R =================================================================== --- src/library/base/R/diag.R (revision 68345) +++ src/library/base/R/diag.R (working copy) @@ -23,9 +23,11 @@ stop("'nrow' or
2011 Jan 31
1
str() on raster objects fails for certain dimensions
Hi, str() on raster objects fails for certain dimensions. For example: > str(as.raster(0, nrow=1, ncol=100)) 'raster' chr [1, 1:100] "#000000" "#000000" "#000000" "#000000" ... > str(as.raster(0, nrow=1, ncol=101)) Error in `[.raster`(object, seq_len(max.len)) : subscript out of bounds This seems to do with how str() and
2013 Aug 30
2
"False" warning on "replacing previous import" when re-exporting identical object
Hi, SETUP: Consider three packages PkgA, PkgB and PkgC. PkgA defines a generic function foo() and exports it; export(foo) PkgB imports PkgA::foo() and re-exports it; importFrom(PkgA, foo) export(foo) PkgC imports everything from PkgA and PkgB: imports(PkgA, PkgB) PROBLEM: Loading or attaching the namespace of PkgC will generate a warning: replacing previous import by
2015 May 12
2
Why is the diag function so slow (for extraction)?
>>>>> Steve Bronder <sbronder at stevebronder.com> >>>>> on Thu, 7 May 2015 11:49:49 -0400 writes: > Is it possible to replace c() with .subset()? It would be possible, but I think "entirely" wrong. .subset() is documented to be an internal function not to be used "lightly" and more to the point it is documented to *NOT*
2012 Feb 23
1
R devel [and R 2.14.1 patched]: R CMD build now sources ~/.Rprofile
I'd like to follow up on this one. It may be that I have misunderstood something, but on both R devel (2012-02-22 r58452) and R 2.14.1 patched (2012-02-18 r58394) I can't seem to avoid loading ~/.Rprofile when I run 'R CMD <cmd>', e.g. R CMD build. For me, the loading of ~/.Rprofile by 'R CMD' started a few weeks ago, and I haven't seen it before. More details
2011 Nov 07
3
CRAN: How to list a non-Sweave doc under "Vignettes:" on package page?
Hi, is it possible to have non-Sweave vignettes(*) in inst/doc/ be listed under 'Downloads' on CRAN package pages? For instance, in my R.rsp package I have a inst/doc/report.pdf (part of the source *.tar.gz) that is not detected/listed. The PDF is not based on a Sweave vignette but an *.tex.rsp vignette that is dynamically created via inst/doc/Makefile. It is listed (*) BTW, can the
2014 Jan 03
2
class() on substitute(...) output?
Does it make sense to talk about the class of the output of substitute(...)? I'm puzzled by the following outputs: ee <- list( A = substitute( a <- 1 ), B = substitute({ a <- 1 }), C = substitute(( a <- 1 )), D = substitute( a == 1 ) ) > t(sapply(ee, FUN=function(e) { c(typeof=typeof(e), mode=mode(e), class=class(e)) })) typeof mode class A
2012 May 22
2
Best way to locate R executable from within R?
Hi, I'd like to spawn of a new R process from within R using system(), e.g. system("R -f myScript.R"). However, just specifying "R" as in that example is not guaranteed to work, because "R" may not be on the OS's search path. What is the best way, from within a running R, to infer the command (basename or full path) for launching R in way that it works on
2015 Oct 09
4
A where() functions that does what exists() does but return the environment when object lives?
Hi, exists("foo", inherits=TRUE) check whether an object named "foo" exists, and get("foo", inherits=TRUE) retrieves it. I'm looking for a similar function to exists() that returns the environment where the object "foo" exists, iff at all. If not found, NULL is returned. Does that exist? EXAMPLE #1: > sample2 <- base::sample > env <-
2014 May 01
3
How to test if an object/argument is "parse tree" - without evaluating it?
This may have been asked before, but is there an elegant way to check whether an variable/argument passed to a function is a "parse tree" for an (unevaluated) expression or not, *without* evaluating it if not? Currently, I do various rather ad hoc eval()+substitute() tricks for this that most likely only work under certain circumstances. Ideally, I'm looking for a isParseTree()
2013 Dec 17
3
In-string variable/symbol substitution: What formats/syntax is out there?
Hi, I'm try to collect a list of methods/packages available in R for doing in-string variable/symbol substitution, e.g. someFcn("pi=${pi}"), anotherFcn("pi=@pi@") and so on becomes "pi=3.141593". I am aware of the following: ** gsubfn() in the 'gsubfn' package, e.g. > gsubfn( , , "pi = $pi, 2pi = `2*pi`") [1] "pi = 3.14159265358979,