[R] Best Mac for R

2015-02-25 Thread Dan Murphy
I am possibly in the market for a new laptop. Predominantly a Windows user, I owned a macbook pro 10 years ago and am considering going that route again. Does the standard advice still hold: Get the most powerful processor (i7), most ram (16GB), and largest internal storage (512GB), if affordable?

Re: [R] Best Mac for R

2015-02-25 Thread Dan Murphy
t; R. Mark Sharp, Ph.D. >> msh...@txbiomed.org >> >> >> >> >> >> > On Feb 25, 2015, at 1:50 PM, Dan Murphy wrote: >> > >> > I am possibly in the market for a new laptop. Predominantly a Windows >> > user, I owned a macbook p

[R] pasteFromExcel

2014-10-19 Thread Dan Murphy
To Users of Excel: Following advice from Brian and Markus, I created an RMarkdown "vignette" that shows an example of how the pasteFromExcel function in the excelRio package on github could be used by an actuary to transfer a triangle from Excel to R. See today's post at http://trinostics.blogspot

Re: [R] pasteFromExcel

2014-10-20 Thread Dan Murphy
20, 2014 at 10:04 AM, David Winsemius wrote: > > On Oct 19, 2014, at 11:18 PM, Dan Murphy wrote: > >> To Users of Excel: >> >> Following advice from Brian and Markus, I created an RMarkdown "vignette" >> that shows an example of how the pasteFromExcel fu

Re: [R] pasteFromExcel

2014-10-20 Thread Dan Murphy
3 4 5 7 # correct answer *Now* one may remove unwanted characters from the well-formed strings. And deal with the "negatives" of course .. and NAs. See how that's done in excelRio.r in the excelRio package on github: https://github.com/trinostics/excelRio Thanks for your interest.

Re: [R] pasteFromExcel

2014-10-21 Thread Dan Murphy
I suppose my biggest holdup is knowing how Excel formats currencies in other denominations. Maybe there's a way for me to test euro, sterling, etc. in my location, but I haven't discovered it yet. :( Again, thanks for your help. -Dan On Mon, Oct 20, 2014 at 3:39 PM, David Winsemius wro

[R] Splitting a string expression into components

2013-07-03 Thread Dan Murphy
I have a vector of strings that contain mathematical expressions. E.g., x <- c("5 <= 7", "z = 1+2") and I would like to decompose each expression into its left- and right-hand-side components etc., output something like "5" "<=" "7" "z" "=" "1" "+" "2" Is there something built into the R language

[R] Calculation with date

2013-03-11 Thread Dan Murphy
The lubridate and seq solutions work because they rely on your specification that the returned date be the first day of the desired subsequent months. Without that requirement they would not always work. For example, if you wanted to add Vec months to the last day of March rather than the first day

[R] do.call environment misunderstanding

2013-06-25 Thread Dan Murphy
<- 2 > f <- function() x^2 > do.call(f, list(), envir = e) Error in (function () : object 'x' not found Thanks in advance for clarifying my misunderstanding. Dan Murphy __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] do.call environment misunderstanding

2013-06-25 Thread Dan Murphy
rdoch wrote: > On 25/06/2013 9:32 AM, Dan Murphy wrote: >> >> I am having difficulty understanding the envir argument of do.call. >> The help page says >> >> envir an environment within which to evaluate the call. >> >> so I thought that in the follo

Re: [R] do.call environment misunderstanding

2013-06-25 Thread Dan Murphy
2013 11:56 AM, Dan Murphy wrote: >> >> So the trick is to put the function f into e and define its environment to >> be e: > > > Putting f into e, and defining the environment of f to be e solve different > problems. Your toy example has both problems so it's a rea

[R] Base within reverses column order

2014-04-04 Thread Dan Murphy
I just noticed this annoyance, but I'm not the first one, apparently -- see http://lists.r-forge.r-project.org/pipermail/datatable-help/2012-May/001176.html The thread never answered the OP's question "Is this a bug?" so I assume the answer, unfortunately, is No. If not a bug, do users of within

Re: [R] Base within reverses column order

2014-04-05 Thread Dan Murphy
hin's assumed backwards column order Is there a way to capture the names of new objects created within? On Fri, Apr 4, 2014 at 10:55 AM, Duncan Murdoch wrote: > On 04/04/2014 1:32 PM, Dan Murphy wrote: >> >> I just noticed this annoyance, but I'm not the first one, appare

[R] Must array methods be defined for user defined classes?

2014-06-30 Thread Dan Murphy
e1, e2) e1 / > as.numeric(e2)) [1] "/" > x / y [1] 2 2 2 2 Is it always necessary to define "array" methods for arithmetic on user defined classes? Maybe the answer has to do with the error message I did not understand. Thanks, Dan Murphy > sessionInfo() R version

[R] (no subject)

2012-11-01 Thread Dan Murphy
and "years", the mondate package on CRAN defines 'mondate' objects that store dates in units of the fraction of the month that the close of business on that date represents relative to the month it is in. Its primary users are financial analysts. There are methods to convert between

[R] Packages Depending on my package

2014-02-06 Thread Dan Murphy
Is there a way to determine which, if any, CRAN packages depend on my CRAN package, mondate? Thanks, Dan Murphy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] meaning of lubridate setdiff

2014-02-09 Thread Dan Murphy
In the lubridate vignette (http://cran.r-project.org/web/packages/lubridate/vignettes/lubridate.html) setdiff(auckland, jsm) results in ## [1] 2011-06-04 12:00:00 NZST--2011-07-20 NZST But if Hadley's mentor had been called away earlier, say, July 31st, wouldn't the set difference have resulted

[R] plyr: colvar value corresponding to max Date

2014-02-13 Thread Dan Murphy
I can do this in multiple steps with summarise, joins, etc., but can't help thinking it can be accomplished in one plyr call. Here's a small example: > require(plyr) > require(lubridate) > data <- data.frame( + date = rep(as.Date(ymd(20140101 + (0:3) * 100)), 2), + state = rep(c("A", "B"), ea

Re: [R] plyr: colvar value corresponding to max Date

2014-02-15 Thread Dan Murphy
13, 2014 at 8:36 AM, arun wrote: > Hi, > Try ?which.max() # unique values for the combination. > > ddply(data,.(state),summarize,max_date=value[which.max(date)])[,2] > #or > ddply(data,.(state),summarize,max_date=value[date == max(date)])[,2] > > > A.K. > >