Re: [Rd] type.convert and doubles

2014-04-21 Thread McGehee, Robert
rame(n=c("72057594037927936", "72057594037927937"), >name=c("foo", "bar")) >length(unique(tmp$n)) ># 2 >write.csv(tmp, "/tmp/foo.csv", quote=FALSE, row.names=FALSE) >data <- read.csv("/tmp/foo.csv") >length(unique(

Re: [Rd] type.convert and doubles

2014-04-17 Thread McGehee, Robert
> This is all application specific and > sort of beyond the scope of type.convert(), which now behaves as it > has been documented to behave. That's only a true statement because the documentation was changed to reflect the new behavior! The new feature in type.convert certainly does not behave

Re: [Rd] type.convert and doubles

2014-04-17 Thread McGehee, Robert
Hi, As Greg suggested, this new feature in type.convert certainly did surprise one user (me), enough so that I had to downgrade back to 3.0.3 until our code was modified to handle the new behavior. Here's my use case: I have a function that pulls arbitrary financial data from a web service call

[Rd] as.Date.character speed improvement suggestion

2013-08-16 Thread McGehee, Robert
R-Devel, I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date cl

[Rd] Substitute / delayedAssign (was: Substitute unaware when promise objects are evaluated)

2013-05-16 Thread McGehee, Robert
this R CMD check warning about .Internal, or is there a better way to write this code? Thanks, Robert -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Wednesday, May 15, 2013 6:04 PM To: McGehee, Robert Cc: R-Devel (r-devel@r-project.org) Subject: Re: [Rd]

[Rd] Substitute unaware when promise objects are evaluated

2013-05-15 Thread McGehee, Robert
R-devel, I used the 'substitute' function to create labels for objects inside an environment, without actually evaluating the objects, as the objects might be promises. However, I was surprised to see that 'substitute' returns the expression slot of the original promise even after the promise h

Re: [Rd] Rebuild package on R 3.0.0 without source code?

2013-04-18 Thread McGehee, Robert
rograms (QCQP), and I haven't yet seen a free R package that can solve this kind of problem (e.g. max q'x - x'Qx subject to x'Qx <= B and Ax=c). Thanks again! Robert -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Thursday, Apr

[Rd] Rebuild package on R 3.0.0 without source code?

2013-04-18 Thread McGehee, Robert
R-developers, I have a binary R package built using R 2.14.1 that I would like to run on R 3.0.0. Unfortunately, the original source code is unavailable, so I cannot rebuild the package as R 3.0.0 requires. Is there a straight forward way of converting the package (.rdb, .rdx and .rds files) in

Re: [Rd] delayedAssign changing values

2012-04-26 Thread McGehee, Robert
.@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of McGehee, Robert Sent: Wednesday, April 25, 2012 5:19 PM To: r-devel@r-project.org Subject: [Rd] delayedAssign changing values I'm not sure if this is a known peculiarity or a bug, but I stumbled across what I think is

[Rd] delayedAssign changing values

2012-04-25 Thread McGehee, Robert
I'm not sure if this is a known peculiarity or a bug, but I stumbled across what I think is very odd behavior from delayedAssign. In the below example x switches values the first two times it is evaluated. > delayedAssign("x", {x <- 2; x+3}) > x==x [1] FALSE > delayedAssign("x", {x <- 2; x+3})

[Rd] with(x, Recall()) Crash

2010-07-06 Thread McGehee, Robert
R-devel, I discovered a segfault in my R code that boiled down to my incorrect use of the Recall() function embedded within a with() function. Since segfaults are generally bad things, even when it's the user's fault for writing nonsense code, I thought I'd pass along the offending code. I've teste

[Rd] POSIXlt matching bug

2010-06-29 Thread McGehee, Robert
I came across the below mis-feature/bug using match with POSIXlt objects (from strptime) in R 2.11.1 (though this appears to be an old issue). > x <- as.POSIXlt(Sys.Date()) > table <- as.POSIXlt(Sys.Date()+0:5) > length(x) [1] 1 > x %in% table # I expect TRUE [1] FALSE FALSE FALSE FALSE FALSE FAL

[Rd] NAs and weighted.mean

2010-06-23 Thread McGehee, Robert
R-developers, In version R 2.11.0, weighted.mean was changed such that: > weighted.mean(NA, na.rm=TRUE) [1] 0 rather than NaN as in previous versions of R. I see a note in the NEWS file indicates that weighted.mean was changed "so an infinite value with zero weight does not force an NaN result."

Re: [Rd] install.packages now intentionally references .Rprofile?

2009-05-29 Thread McGehee, Robert
I see that related to this thread, 'R CMD INSTALL' (like 'install.packages') also reads the .Rprofile before beginning. This caused package installation headaches for me that developers should be aware (as it was very difficult to debug). I added a setwd() to my .Rprofile [for example: setwd("/tmp

[Rd] S4 object does not commute?

2008-10-27 Thread McGehee, Robert
Hello all, It appears that for the simplest of S4 objects, z+1 does not equal 1+z. Presumably this is a bug, as 1+z seems to make a malformed object (at least malformed as an input to str). Thanks, Robert > setClass("test", representation("vector")) [1] "test" > z <- new("test", 1) > identical(z+

[Rd] sapply(Date, is.numeric)

2008-07-29 Thread McGehee, Robert
ncoming" bug is dated 25 May 2008, so perhaps others are having difficulty as well. (cc: r-bugs) Cheers, Robert -Original Message- From: McGehee, Robert Sent: Monday, July 14, 2008 9:51 AM To: [EMAIL PROTECTED] Subject: sapply(Date, is.numeric) R-developers, The results below are in

[Rd] split.Date

2008-07-08 Thread McGehee, Robert
Hello, I wanted to suggest that the below method for split.Date be added to the base library to significantly speed up splits with values of class Date. In the below example I show a speed improvement of 175x for 1000 data points. On a vector of size 1e6, the time difference was 22 minutes for spli

Re: [Rd] var/sd and NAs in R2.7.0

2008-05-16 Thread McGehee, Robert
Oops, as I just realized, var does have a 'use' argument in 2.6.2, so I can just use Gabor's suggestion for var. Sorry for that Gabor. -Original Message- From: McGehee, Robert Sent: Friday, May 16, 2008 11:20 AM To: 'Gabor Grothendieck' Cc: R-devel Subject: R

Re: [Rd] var/sd and NAs in R2.7.0

2008-05-16 Thread McGehee, Robert
o check the argument list of var every time I use it. if ("use" %in% names(formals(var))) var(x, na.rm=TRUE, use="p") else var(x, na.rm=TRUE) -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 11:03 AM To:

[Rd] var/sd and NAs in R2.7.0

2008-05-16 Thread McGehee, Robert
Hello all, I just upgraded to R 2.7.0 and found that the behavior of 'var' and 'sd' have changed in the presence NAs (this wasn't explicit in the NEWS file, though I see it probably has to do with the change for cor/cov). Anyway, I just want to make sure that it was intentional to produce an error

[Rd] NAs and Infinitely Large POSIXct Objects

2008-04-14 Thread McGehee, Robert
Hello, I got bungled up by the fact that an infinite POSIXct object is represented by NA, but is not, in fact, NA. While an infinitely large POSIXct object seems strange, perhaps R should use the convention of representing it as Inf rather than NA to avoid any confusion. Cheers, Robert > x <- as.

Re: [Rd] saving objects with embedded environments

2007-07-02 Thread McGehee, Robert
puter's memory and swap space after repeated calls. Thanks, Robert -Original Message- From: Roger Peng [mailto:[EMAIL PROTECTED] Sent: Friday, June 29, 2007 7:44 PM To: McGehee, Robert Cc: R-devel Subject: Re: [Rd] saving objects with embedded environments I believe this is intentiona

[Rd] saving objects with embedded environments

2007-06-28 Thread McGehee, Robert
Hello, I have been running linear regressions on large data sets. As 'lm' saves a great deal of extraneous (for me) data including the residuals, fitted.values, model frame, etc., I generally set these to NULL within the object before saving off the model to a file. In the below example, however,

[Rd] NaN in crossprod

2007-06-15 Thread McGehee, Robert
Hello, I have come across a troubling problem in which my call to crossprod will occasionally produce NaNs. That is, a proper matrix cross-product will be produced except that some of the matrix elements will arbitrarily be NaN. For my purposes, this is extremely bad. On several different R sessio

Re: [Rd] Chi-squared test (PR#9350)

2006-11-08 Thread McGehee, Robert
Is Sahotra's abuse sending a wishlist item to R-bugs, or is his error phrasing a suggestion in the form of a question? It seems others have commented on the inability to specify df for chisq.test (see: http://tolstoy.newcastle.edu.au/R/help/05/01/10539.html), and adding an option certainly seems li

[Rd] Argument error reporting slowness

2006-10-31 Thread McGehee, Robert
Hello, My work with large datasets slows down a fair amount in R 2.4.0 when I mistakenly pass in a large dataset using an incorrect argument. That is, the same error message for reporting an incorrect argument usage when I pass in a 1e8 length matrix takes 3 minutes on R 2.4.0 versus 0.01 seconds o

Re: [Rd] Changing function arguments

2006-10-23 Thread McGehee, Robert
allArgs <- as.list(mc[-1]) allArgs[[arg]] <- curArg + offset e <- do.call("call", c(as.character(mc[[1]]), allArgs)) } for (i in 1:length(e)) e[[i]] <- Recall(e[[i]], arg = arg, offset = offset) return(e) } -Original Message- From: Thomas L

[Rd] Changing function arguments

2006-10-22 Thread McGehee, Robert
R-Developers, I'm looking for some help computing on the R language. I'm hoping to write a function that parses a language or expression object and returns another expression with all instances of certain argument of a given function altered. For instance, say I would like my function, myFun to ta

Re: [Rd] x86_64, acml-3.5.0-gfortran64 and lme4

2006-10-16 Thread McGehee, Robert
I am not encountering segfaults on a 64-bit build of R 2.4.0 compiled with gcc and g77 3.4.5 and ATLAS 3.6.0 on a Red Hat Athlon64 system. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas Bates Sent: Monday, October 16, 2006 10:26 AM To: R Developme

Re: [Rd] Installing Rmpi on 64-bit Linux Athlon

2006-10-13 Thread McGehee, Robert
ry changes to the package maintainer. Best, Robert -Original Message- From: Hin-Tak Leung [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 6:10 AM To: [EMAIL PROTECTED] Cc: McGehee, Robert; r-devel@stat.math.ethz.ch Subject: Re: [Rd] Installing Rmpi on 64-bit Linux Athlon No

[Rd] Installing Rmpi on 64-bit Linux Athlon

2006-10-09 Thread McGehee, Robert
Hello, We have recently added a 64-bit 2 x Dual-Core Athlon server running Red Hat Enterprise Linux AS release 3 to allow for processing of large data sets (>4GB) in R. To integrate this server into our Linux cluster, I have been trying (unsuccessfully) to use Rmpi/lam-mpi to parallel process some

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread McGehee, Robert
CanUse? If the 'Suggests' field "lists packages that are not necessarily needed" (Writing R Extensions), then why is the user required to have the package installed to pass R CMD check? Likewise, if a CanMakeUseOf field is added, then why would one choose to use Suggests at all? That is, is there

[Rd] 32- / 64-bit R query

2006-08-18 Thread McGehee, Robert
Hello, Is there a way to query whether R has been compiled using 32- or 64-bits? A certain memory-intensive simulation will need to be optimized differently depending on the memory constraints of the architecture such that it will run quickly in 64-bits, and will run within ~3GB under 32-bits. And

Re: [Rd] seq improperly increments dates (PR#9120)

2006-08-03 Thread McGehee, Robert
Definitely not a bug. You seem to expect seq.Date to have an entirely different convention depending on whether you are at the beginning of the month or at the end of the month, which does not seem reasonable to me. For instance, does adding a month to Feb 28th give March 28th or March 31st? Given

Re: [Rd] Suggestion for all.equal.factor

2006-06-22 Thread McGehee, Robert
rom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of McGehee, Robert Sent: Wednesday, June 21, 2006 7:13 PM To: R-devel Subject: [Rd] Suggestion for all.equal.factor R-Devel, all.equal.factor gives a warning message when comparing vectors of factors of different lengths. I suspect

[Rd] Suggestion for all.equal.factor

2006-06-21 Thread McGehee, Robert
R-Devel, all.equal.factor gives a warning message when comparing vectors of factors of different lengths. I suspect this to be unintentional as I believe tests of valid factors should be comparable without a warning. For example: > x1 <- as.factor(LETTERS) > x2 <- as.factor(LETTERS)[1:10] > all.eq

[Rd] Wishlist: Vignettes on CRAN

2006-05-22 Thread McGehee, Robert
I was recently browsing through CRAN's Finance task view to remind myself of the publicly available packages relevant to my work. As the reference manuals are all online, I am able to flip through the available functions to get an idea of the package's scope before downloading. That said, many au

Re: [Rd] S4 classes and C

2006-05-18 Thread McGehee, Robert
I believe the paper on which those lecture notes were based can be found here: http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Drafts/BatesDebRoy.pdf -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ross Boylan Sent: Thursday, May 18, 2006 1:45 PM To: R De

[Rd] .leap.seconds

2006-01-12 Thread McGehee, Robert
I glanced at the .leap.seconds object and noticed that it has not been updated for the most recent leap second that occurred 2005 December 31, 23h 59m 60s. See the IERS bulletin here: http://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat Moreover, after a more careful glance at the .leap.seconds obje

Re: [Rd] ID for machine?

2005-12-09 Thread McGehee, Robert
Not an R function, per se, but > system("uname -n", intern = TRUE) returns my computer's network node hostname on both Windows and Linux. You can use 'uname -a' for more information. -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: Friday, December 09, 2005 9:31 AM

Re: [Rd] read.table error upon package installation (PR#8230)

2005-10-21 Thread McGehee, Robert
, everyone who needs to edit this file can just do so in emacs, and putting quotes around the fields is an easy fix. Thanks Robert -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 9:59 AM To: McGehee, Robert Cc: r-devel@stat.math.ethz.

Re: [Rd] read.table error upon package installation (PR#8230)

2005-10-21 Thread McGehee, Robert
Thanks for this. I tried switching the file extension from txt to tab, but it seems to still split on whitespace rather than tabs. My goal is to create a file that is both readable by R and by a spreadsheet program, and that may contain white spaces. If tab-delimited separation is not currently

Re: [Rd] write.csv suggestion

2005-06-29 Thread McGehee, Robert
y [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 4:16 PM To: McGehee, Robert Cc: r-devel@stat.math.ethz.ch Subject: Re: [Rd] write.csv suggestion The help page says By default there is no column name for a column of row names. If 'col.names = NA' and 'row.nam

[Rd] write.csv suggestion

2005-06-29 Thread McGehee, Robert
Hello all, I had some trouble recently with write.csv because I couldn't change one of the default options. A quick view of the code showed that the function was not defined in the most optimal way. Currently, write.csv <- function (..., col.names = NA, sep = ",", qmethod = "double") wri