similar to: factor() on a double vector

Displaying 20 results from an estimated 10000 matches similar to: "factor() on a double vector"

2011 Dec 09
3
bug in sum() on integer vector
Hi, x <- c(rep(1800000003L, 10000000), -rep(1200000002L, 15000000)) This is correct: > sum(as.double(x)) [1] 0 This is not: > sum(x) [1] 4996000 Returning NA (with a warning) would also be acceptable for the latter. That would make it consistent with cumsum(x): > cumsum(x)[length(x)] [1] NA Warning message: Integer overflow in 'cumsum'; use
2010 Nov 12
1
Optimizing compilation of R
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi I know this has been asked before, but I can not find it - so my apologies. I want to compile R myself, to optimize it for speed. There is a small section (a few lines actually) in the R-admin manual (Compilation-flags) which states that the LDFLAGS "on recent systems ?'-Bdirect,--hash-style=both,-Wl,-O1'? is recommended". But
2010 Jul 21
1
new bug in install.packages()
Hi, install.packages() seems to be broken in latest R-devel snapshot (2010-07-19 r52561) if you are using an R/R.version$platform-library/x.y directory. > .libPaths() [1] "/home/hpages/R/x86_64-unknown-linux-gnu-library/2.12" [2] "/home/hpages/R-2.12/library" > install.packages("car") Error in sprintf(gettext(fmt, domain = domain), ...) : too
2008 Dec 01
2
[BioC] BioC 2.3 standard installation
I always followed http://cran.r-project.org/bin/linux/ubuntu/ to install R on Ubuntu 8.1. I had no errors before! > install.packages("XML") Warning in install.packages("XML") : argument 'lib' is missing: using '/usr/local/lib/R/site-library' --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ... done trying URL
2010 Oct 02
1
cleanup_pkg() in tools:::.build_packages() is broken
Hi, The cleanup_pkg() function defined the big tools:::.build_packages() function in tools/R/build.R is currently broken. When Makefiles are used cleanup_pkg() doesn't clean anything because of the way system2() is called. For example, the call to Ssystem() on line 304 (Ssystem is a silent version of system2) is basically trying to do this: >
2010 Oct 29
1
list2env() is broken
Hi, The following code produces different kinds of problems depending on which platform you run it: x <- as.list(1:200000) names(x) <- paste("A", 1:200000, sep="") e <- list2env(x) Timeout on Linux, crash on Mac and Windows, with R 2.12.0 and current R devel. The "multi-assign" mode (i.e. when the 'envir' arg is supplied) doesn't seem
2011 Feb 24
1
min/max of a vector with NAs and NaNs
I get this (with R-2.12 and R-2.13, didn't try with earlier versions): > max(c(NaN, NA)) [1] NA > max(c(NA, NaN)) [1] NaN I get the same thing with min(). The fact that the result of 'max(x)' or 'min(x)' depends on the order of the elements in 'x' is surprising. It also seems to contradict the man page: By definition the min/max of a numeric vector
2010 Oct 11
1
'R CMD build' not cleaning the src/ folder on Windows
Hi, 'R CMD build' (with R 2.12.0 RC) fails to clean the src/ folder on Windows: D:\biocbld\bbs-2.7-bioc>ls meat/BUS/src BUS.cpp BUS.h D:\biocbld\bbs-2.7-bioc>R\bin\R CMD build meat\BUS * checking for file 'meat\BUS/DESCRIPTION' ... OK * preparing 'BUS': * checking DESCRIPTION meta-information ... OK * cleaning src * installing the package
2010 Jun 04
2
Argument recycling in substring()
Hi, According to its man page substring() "expands (its) arguments cyclically to the length of the longest _provided_ none are of zero length". So, as expected, I get an error here: > substring("abcd", first=2L, last=integer(0)) Error in substring("abcd", first = 2L, last = integer(0)) : invalid substring argument(s) But I don't get one here:
2018 Jan 30
2
as.list method for by Objects
by() does not always return a list. In Gabe's example, it returns an integer, thus it is coerced to a list. as.list() means that it should be a VECSXP, not necessarily with "list" in the class attribute. Michael On Tue, Jan 30, 2018 at 2:41 PM, Herv? Pag?s <hpages at fredhutch.org> wrote: > Hi Gabe, > > Interestingly the behavior of as.list() on by objects seem to
2018 Jan 30
2
as.list method for by Objects
Dario, What version of R are you using. In my mildly old 3.4.0 installation and in the version of Revel I have lying around (also mildly old...) I don't see the behavior I think you are describing > b = by(1:2, 1:2, identity) > class(as.list(b)) [1] "list" > sessionInfo() R Under development (unstable) (2017-12-19 r73926) Platform: x86_64-apple-darwin15.6.0 (64-bit)
2016 Mar 19
2
unary class union of an S3 class
On 03/19/2016 01:22 AM, Michael Lawrence wrote: > > > On Sat, Mar 19, 2016 at 12:10 AM, Herv? Pag?s <hpages at fredhutch.org > <mailto:hpages at fredhutch.org>> wrote: > > On 03/18/2016 03:28 PM, Michael Lawrence wrote: > > > On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s > <hpages at fredhutch.org <mailto:hpages at
2017 Apr 26
4
byte-compiler bug
Hi, I'm running into a case where byte-compilation changes the semantic of a function. This is with R 3.4.0: foo <- function(x) { TRUE && x } foo(c(a=FALSE)) # [1] FALSE # OK foo(c(a=TRUE)) # [1] TRUE # OK foo(c(a=FALSE)) # a # ???? # FALSE The 3rd call returned a result that it different from the 1st call! After
2010 Nov 01
2
transforming a dataset for association analysis RESHAPE2
I get the following message when using the reshape2 package line > tDat.m<- melt(Dataset) Using Item, Subject as id variables > tDatCast<- acast(tDat.m,Subject~Item) Aggregation function missing: defaulting to length Note Problem Statement- convert dataframe Subject Item Score 1 Subject 1 Item 1 1 2 Subject 1 Item 2 0 3 Subject 1 Item 3 1 4 Subject 2 Item 1 1 5
2016 Mar 19
2
unary class union of an S3 class
On 03/18/2016 03:28 PM, Michael Lawrence wrote: > > On Fri, Mar 18, 2016 at 2:53 PM, Herv? Pag?s <hpages at fredhutch.org > <mailto:hpages at fredhutch.org>> wrote: > > Hi, > > Short story > ----------- > > setClassUnion("ArrayLike", "array") > > showClass("ArrayLike") # no slot > >
2010 Sep 16
1
Lack of consistent cross-platform behaviour of tools:::buildVignettes()
Hi, On both Unix and Windows there is a mechanism to add variables to the environment when R is started. I noticed that, on Unix, this mechanism is not used when R is started normally at the command line but only when it's started using the 'R CMD' syntax. One problem with this is some lack of consistent cross-platform behaviour. For example: On Linux: $ echo $TEXINPUTS $
2018 Jan 30
2
as.list method for by Objects
I just meant that the minimal contract for as.list() appears to be that it returns a VECSXP. To the user, we might say that is.list() will always return TRUE. I'm not sure we can expect consistency across methods beyond that, nor is it feasible at this point to match the semantics of the methods package. It deals in "class space" while as.list() deals in "typeof() space".
2012 Oct 19
2
Mac and Windows binaries of rJava broken for R-devel?
Hi, Here is a problem we see with the Mac and Windows binaries of rJava (0.9-3) currently available on CRAN for R-devel (i.e. under bin/macosx/leopard/contrib/2.16/ and bin/windows/contrib/2.16/): > library(rJava) > .jinit("gaggle/inst/jars/gaggleRShell.jar") Error in .Call("R_do_new_object", ClassDef, PACKAGE = "base") :
2010 Sep 30
1
tar problem when using 'R CMD build' on Windows
Hi, Already reported here: https://stat.ethz.ch/pipermail/r-devel/2010-September/058636.html but it doesn't seem to be related (at least not in an obvious way) to the problems described in that previous thread. So the problem is that, with recent versions of R 2.12 (i.e. current R-alpha but I've observed this with R-devel for at least 2-3 months now), 'R CMD build
2023 Nov 03
2
'R CMD INSTALL' keeps going on despite serious errors, and returns exit code 0
Hi list, Here is an example: ??? hpages at XPS15:~$ R CMD INSTALL CoreGx ??? * installing to library ?/home/hpages/R/R-4.4.r85388/site-library? ??? * installing *source* package ?CoreGx? ... ??? ** using staged installation ??? ** R ??? ** data ??? *** moving datasets to lazyload DB ??? ** inst ??? ** byte-compile and prepare package for lazy loading ??? Error : in method for