On 2015-01-24 01:14, William Dunlap wrote:
Here is one way. Sort the data.frame, first by Name then break ties with
CheckInDate.
Then choose the rows that are the last in a run of identical Name values.
I do it by sorting by the reverse order of CheckinDate (last date first)
within Name,
Dear Jerad
I may have completely misunderstood your question but you do know that
you can write your own function and use it in sapply where you have
summary? You could incorporate calls to summary or to coef or somet
other extractor or you could use the $ tool.
On 25/01/2015 02:01, Moxley,
Jun:
Call a custom panel function that adds horizontal lines at the means
of your groups. Something like (for vertical boxes, i.e.horiz=FALSE;
make appropriate change for horizontal boxes)
e.g.
panel.mn - function(x,y,box.width=.5,horiz=FALSE,...){
panel.bwplot(x,y,box.width,horiz=horiz,...)
dLatestVisit - dSorted[!duplicated(dSorted$Name), ]
I guess it is faster, but who knows?
You can find out by making a function that generates datasets of
various sizes and timing the suggested algorithms. E.g.,
makeData -
function(nPatients, aveVisitsPerPatient, uniqueNameDate = TRUE){
Dear list,
The bwplot generates box plots with a dot in median. How do I add a line of
mean to the boxes? Thanks a lot.
Jun
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
On Jan 24, 2015, at 11:02 PM, Moxley, Jerad wrote:
Sorry I was not clearer, but I was asking an R programming question not a
theory question.
Copying back the original text which appears to have been omitted:
On 25/01/2015 02:01, Moxley, Jerad wrote:
I’m trying to test what growth
On 25/01/2015 2:38 PM, Dr. Alireza Zolfaghari wrote:
Hi there,
does any one know how to plot the both d1 and d2 data in one unique x and y
axis?
Use plot() for the first call, and points() for the second one. You may
need to specify xlim and/or ylim explicitly in the first call to be sure
Hi Dr. Zolfaghari,
Given that the probability of practically the same unusual question
coming from two people in quick succession is tiny unless it is about
a homework question, I was probably conned into answering a homework
question a day or two ago. Of course by the time I had decoded your
Hi Allen,
How about this:
sum_w_NA-function(x) ifelse(all(is.na(x)),NA,sum(x,na.rm=TRUE))
Jim
On Mon, Jan 26, 2015 at 10:21 AM, Allen Bingham aebingh...@gmail.com wrote:
I understand that in order to get the sum function to ignore missing values
I need to supply the argument na.rm=TRUE.
As the Wikipedia page you took your example problem from explains, the sets
cover problem can be formulated as an integer linear programming problem.
In R, such problems will be solved effectively applying one of the available
MILP packages, for example LPsolve or Rsymphony.
Kumar Mainali
I understand that in order to get the sum function to ignore missing values
I need to supply the argument na.rm=TRUE. However, when summing numeric
values in which ALL components are NA ... the result is 0.0 ... instead of
(what I would get from SAS) of NA (or in the case of SAS .).
Accordingly,
Dear Allen,
This seems reasonably straightforward to me, suggesting that I might not
properly understand what you want to do. How about something like the following?
mysum - function(...){
+ x - c(...)
+ if (all(is.na(x))) NA else sum(x, na.rm=TRUE)
+ }
mysum(1, 2, 3, NA)
[1] 6
Hi there,
does any one know how to plot the both d1 and d2 data in one unique x and y
axis?
thanks
Alireza
convertToRadius-function(x){return(sqrt(x/pi))}
myd=data.frame(x=c(84390255386 ,74390255386, 78028317380 ,53594648044,422)
,y=c(949849442 ,941645043, 840135292, 74,
See inline;
On 2015-01-25 20:27, William Dunlap wrote:
dLatestVisit - dSorted[!duplicated(dSorted$__Name), ]
I guess it is faster, but who knows?
You can find out by making a function that generates datasets of
various sizes and timing the suggested algorithms. E.g.,
makeData -
14 matches
Mail list logo