similar to: Selection and aggregation in one operation?

Displaying 20 results from an estimated 6000 matches similar to: "Selection and aggregation in one operation?"

2009 May 27
5
How to exclude a column by name?
Given an arbitrary data frame, it is easy to exclude a column given its index: df[,-2]. How to do the same thing given the column name? A naive attempt df[,-"name"] did not work :)
2009 May 12
2
From two colors to 01 sequences
Dear All, Perhaps, what I am asking is impossible, but I am asking it anyway. I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or data frame converting the color of the rectangles to sequences of 01? Thanks in advance, Paul
2009 May 10
1
ggplot2: recommended workaround for broken legend.position="top"
Searching the mail archives I found that using legend.position as in p.ring.3 + opts(legend.position="top") is a known bug. I tried doing p.ring.3 + opts(legend.position=c(0.8, 0.2)) which works, but the legend background is transparent, i.e. I see the plot background through the legend. Adding additional option opts(legend.background=theme_rect(fill=TRUE,colour="white"))
2009 May 01
2
Reccomendation for graphics package
Hello, What would you recommend for producing publication-quality plots with R? Built-in graphics, trellis, ggplot2, or something else? Basic requirements: - I need to draw line-, box-, density-plots, bar-charts and histograms - error bars on bar- and box-plots - easy tiling of multiple plots on a single "page" Basic R plotting with mfrow and mfcol parameters is not satisfactory
2009 May 05
2
problem with ggplot2 boxplot, groups and facets
I have a following problem: The call qplot(wg, v.realtime, data=df.best.medians$gv1, colour=sp, geom="boxplot") works nice: for each value of the wg factor I get two box-plots (two levels in the sp factor) in different colours, side-by-side, centered at the wg x-axis. However, I want to separate the data belonging to different levels of the n factor, so I add the facets option:
2009 May 04
2
Calculating relative ratios in a data frame..
I have a data-set that is structured as follows: sp wg n v.realtime v.cputime v.tcputime v.idletime v.nswtch 9 0 1 1 28.61300 28.61 28.6039 0.00000e+00 407 1563 0 1 2 15.20270 30.38 28.5981 9.80523e-01 483 3128 0 1 4 12.50930 50.00 28.6053 1.07877e+01 489 4682 0 1 6 12.10260 72.55
2009 May 03
7
running R on netbooks/minis?
Dear R People: Is it possible to run R on a netbook/mini, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
2009 May 21
1
postscript problems (landscape orientation)
I use the following function to export some figures to .eps: p.eps <- function(p, fname, title = NULL, width, height) { postscript(file=fname, onefile=FALSE, paper="special", width=width, height=height, horizontal=FALSE) print(p + opts(title = title)) dev.off() } Whenever I have a page consisting of *only* figures exported in this way, Acrobat Reader shows them in
2009 Jun 01
1
ggplot2: How to export several plots with same width?
I have three plots and I want the *plot area* to be of the same width on each plot. Since the three plots have different legends, the text width of the legend affects the width of the plot area (longer legend text = narrower plot area). Exporting the three figures to postscript device of same size gives thus unequal plot areas. How can I calculate the correct width of postscript device for each
2012 May 08
2
How to deal with a dataframe within a dataframe?
Hello all, I am doing an aggregation where the aggregating function returns not a single numeric value but a vector of two elements using return(c(val1, val2)). I don't know how to access the individual columns of that vector in the resulting dataframe though. How is this done correctly? Thanks, robert > agg <- aggregate(formula=df$value ~ df$quarter + df$tool, + FUN=cp.cpk,
2007 Jul 13
2
Suggestion to extend aggregate() to return multiple and/or named values
Hi all, This is my first post to the developers list. As I understand it, aggregate() currently repeats a function across cells in a dataframe but is only able to handle functions with single value returns. Aggregate() also lacks the ability to retain the names given to the returned value. I've created an agg() function (pasted below) that is apparently backwards compatible (i.e.
2007 Nov 06
1
[LLVMdev] Passing and returning aggregates (who is responsible for the ABI?)
On 6 nov. 07, at 06:17, Chris Lattner wrote: >> But then, why refuse aggregates as input or output of a call? What is >> the rationale? > > Because LLVM has no notion of aggregates as "values" that can be > passed around as atomic units. This is a very important design point, > and has many useful values. I see. You explained one of them in a message on the XL
2006 Sep 21
1
transforming factor back to numbers
Hi I generate a new dataframe by doing: npl.agg <- aggregate(npl$DensPlants, list(year=npl$year, sim=npl$sim), mean, na.rm=TRUE ) Now I want to plot it by using coplot(npl.agg$x ~ npl.agg$year | npl.agg$sim, type="l") but, as npl.agg$year is seen as a factor, the order of the points on the x-axis (time axis) does not follow the numerical sorting 1...100, but rather the text
2009 Mar 30
3
Calculating First Occurance by a factor
I'm having difficulty finding a solution to my problem that without using a for loop. For the amount of data I (will) have, the for loop will probably be too slow. I tried searching around before posting and couldn't find anything, hopefully it's not embarrassingly easy. Consider the data.frame, Data, below Data Sub Tr IA FixInx FixTime p1 t1 1 1 200 p1 t1 2
2007 Dec 16
2
question about the aggregate function with respect to order of levels of grouping elements
Hi, I am using aggregate() to add up groups of data according to year and month. It seems that the function aggregate() automatically sorts the levels of factors of the grouping elements, even if the order of the levels of factors is supplied. I am wondering if this is a bug, or if I missed something important. Below is an example that shows what I mean. Does anyone know if this is just the way
2011 Oct 06
2
[LLVMdev] A potential bug
Hi all, There might be a bug in DeadStoreElimination.cpp. This pass eliminates stores backwards aggressively in an end BB. It does not check dependencies on stores in an end BB though. For example, in this code snippet: ... 1. %sum.safe_r47.pre-phi = phi i64* [ %sum.safe_r47.pre, %entry.for.end_crit_edge ], [ %sum.safe_r42, %for.body ] 2. %call9 = call i32 @gettimeofday(%struct.timeval* %end,
2008 Aug 12
2
perl expression question
I have a string such as fileName<-"Agg.20.20.20-all-01". All I want to do is pull the "20.20.20" and the "all" as strings. Obviously, they aren't always those values. The "20.20.20" can be "30.30.30" but it's always after the . which is next to the second g in Agg and it's always the same length. The all might not always be
2004 Jun 15
1
R: slope estimations of teeth like data
On 15 Jun 2004 at 13:52, Vito Muggeo wrote: > Dear Petr, > Probably I don't understand exactly what you are looking for. > > However your "plot(x,c(y,z))" suggests a broken-line model for the > response "c(y,x)" versus the variables x. Therefore you could estimate > a segmented model to obtain (different) slope (and breakpoint) > estimates. See
2011 Oct 06
0
[LLVMdev] A potential bug
On Thu, Oct 6, 2011 at 2:12 PM, Zeng Bin <ezengbin at gmail.com> wrote: > Hi all, > > There might be a bug in DeadStoreElimination.cpp. This pass eliminates > stores backwards aggressively in an end BB. It does not check dependencies > on stores in an end BB though. For example, in this code snippet: >   ... > 1.  %sum.safe_r47.pre-phi = phi i64* [ %sum.safe_r47.pre,
2011 Oct 06
2
[LLVMdev] A potential bug
On Thu, Oct 6, 2011 at 2:20 PM, Eli Friedman <eli.friedman at gmail.com> wrote: > On Thu, Oct 6, 2011 at 2:12 PM, Zeng Bin <ezengbin at gmail.com> wrote: >> Hi all, >> >> There might be a bug in DeadStoreElimination.cpp. This pass eliminates >> stores backwards aggressively in an end BB. It does not check dependencies >> on stores in an end BB though.