similar to: Apply pmax to dataframe with different args based on dataframe factor

Displaying 20 results from an estimated 8000 matches similar to: "Apply pmax to dataframe with different args based on dataframe factor"

2013 May 27
1
Question about subsetting S4 object in ROCR
Dear list I'm testing a predictor and I produced nice performance plots with ROCR package utilizing the 3 standard command pred <- prediction(predictions, labels) perf <- performance(pred, measure = "tpr", x.measure = "fpr") plot(perf, col=rainbow(10)) The pred object and the perfo object are S4 with the following slots An object of class "performance"
2013 Mar 06
3
About basic logical operators
Hello everyone,           I have a basic question regarding logical operators. > x<-seq(-1,1,by=0.02) > x   [1] -1.00 -0.98 -0.96 -0.94 -0.92 -0.90 -0.88 -0.86 -0.84 -0.82 -0.80 -0.78  [13] -0.76 -0.74 -0.72 -0.70 -0.68 -0.66 -0.64 -0.62 -0.60 -0.58 -0.56 -0.54  [25] -0.52 -0.50 -0.48 -0.46 -0.44 -0.42 -0.40 -0.38 -0.36 -0.34 -0.32 -0.30  [37] -0.28 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16
2011 Feb 10
3
help - "the condition has length > 1 and only the first element will be used"
Hello there, I don't know if I'm addressing my question to the right e-mail address, I hope I do. Actually I have a little problem concerning writing a code in R. I try to briefly sum up my problem. As you can see below, I created the functions "Equation1" and "Equation2" with some conditions. Equation1 <-function(x){ if
2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called heatmap.w.row.and.col.clust which auto-generates breaks using breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20, digits = 2) #(stddev in this case = 2.5) This has always worked well in the past but now I am getting an error that non-finite breaks are being generated. Drilling down, it seems that my wrapper is generating finite
2011 Jan 31
5
Finding a Diff within a Dataframe columns
Hi, I have a Dataframe. A B C D 0.1 0.7 0.9 0.8 0.20 0.60 0.80 0.70 0.40 0.80 0.70 0.76 I need a resultant dataframe (A-B) (C-D) -0.6 0.1 -0.40 0.1 -0.40 -0.06 Any suggestion would be of a great help Thanks Ramya -- View this message in context: http://r.789695.n4.nabble.com/Finding-a-Diff-within-a-Dataframe-columns-tp3247943p3247943.html Sent from
2011 Jun 21
4
ddply to count frequency of combinations
I have a dataframe df with two columns x and y. I want to count the number of times a unique x, y combination occurs. For example x<- c(1,2,3,4,5,1,2,3,4) y<- c(1,2,3,4,5,1,2,4,1) df<-as.data.frame(cbind(x, y)) #what is the correct way to use ddply for this example? ddply(df, c('x','y', summarize, ??) #desired output -- format and order doesn't matter # (x, y)
2010 Mar 31
1
Weird R behaviour?
Dear list, I have observed a weird behaviour from R --- apologies if I am missing something obvious! df3f826f28 df3f826f28 Say you type in R: >c.preec <- 10074 >c.gd <- 2200 >p1 <- .2 >c.neo <- p1*9451 + (1-p1)*3883 >n.preec <- 3710 >n.gd <- 2650 >n.neo <- 2120 >n.pcos <- 53000 >unit.met <- 94 >cost.met <- 94*n.pcos >effect <-
2011 Apr 23
3
Problem having tick marks aligned when plotting three graphs on top of one another.
R 2.10 Windows 7 I am trying to plot three graphs on top of each other. I need to have the axises perfectly aligned. For some reason the ticks on the y axes are slightly off so they do not perfectly align. Can someone tell me how I can get the to overlay each other perfectly? I thought the yaxp parameter would solve my problem, but it does not. My data and code follows: >
2007 Apr 25
1
help
Hi all, I have 2 questions: 1)How do I calculate the mean on an imported txt file? I've imported the file below and that's what it looks like imported. How do I then calcuate the mean, median, or mode on the column LeafArea using the desktop R package? Any help would be greatly appreciated!! Thanks, Nat LeafType Leaflets LeafArea ShapeRatio LeafWeight LeafThickness 1 1
2011 Jun 09
3
[LLVMdev] -fplugin-arg-dragonegg-enable-gcc-optzns status
On Thu, Jun 09, 2011 at 03:44:40PM +0200, Duncan Sands wrote: > Hi Jack, thanks for doing this. > >> Below are the tabulated compile times and executable sizes. >> >> A) gcc 4.5.4svn using -msse3 -ffast-math -O3 -fno-tree-vectorize >> B) gcc 4.5.4svn/dragonegg using -msse3 -ffast-math -O3 -fno-tree-vectorize -fplugin-arg-dragonegg-enable-gcc-optzns >> C)
2010 Nov 08
4
2.0, hourly performance stats
I'm getting constantly high numbers of page reclaims & involuntary context switches for dovecot/auth. page reclaims = minor faults = cpu switching back to system-mode, But why is the auth process doing that so excessively? Same for the large number of involuntary context switches... Attached is my "dovecot -n" output. Date: Sun, 07 Nov 2010 20:40:34 +0100 type real
2013 May 23
1
sample(c(0, 1)...) vs. rbinom
Greetings.? My wife is teaching an introductory stat class at UC Davis.? The class emphasizes the use of simulations, rather than mathematics, to get insight into statistics, and R is the mandated tool.?? A student in the class recently inquired about different approaches to sampling from a binomial distribution.? I've appended some code that exhibits the idea, the gist of which is that using
2012 Oct 06
3
vector is not assigned correctly in for loop
Hi there, Here is a minimum working example: ---------------------------------------------------------------- lower = 0 upper = 1 n_bins = 50 interval = (upper - lower) / n_bins bins = vector(mode="numeric", length=n_bins) breaks = seq(from=lower + interval, to=upper, by=interval) for(idx in breaks) { bins[idx / interval] = idx } print(bins)
2013 Jan 24
4
sorting/grouping/classification problem?
Hi, I'm a database admin for a database which manage chromatographic results of products during stability studies. I use R for the reporting of the results in MS Word through R2wd. But now I think I need your help: suppose we have the following data frame: ID rrt Mnd Result 1 0.45 0 0.10 1 0.48 0 0.30 1 1.24 0 0.50 2 0.45 3 0.20 2 0.48 3 0.60 2 1.22 3 0.40 3
2011 Sep 16
1
plot(m, which = 1), where m is a lm linear model. What is 'which' doing?
Sample code from *R CookBook* (awesome book btw) *11.12: Finding the Best Power Transformation (Box-Cox) Procedure* require(MASS) x <- 10:100 eps <- rnorm(length(x), sd = 5) y <- (x + eps)^(-1 / 1.5) m <- lm(y ~ x) # ***************** What does the *which* in this line do??? ******************************************** plot(m, which = 1) [[alternative HTML version deleted]]
2011 Jun 10
0
[LLVMdev] -fplugin-arg-dragonegg-enable-gcc-optzns status
Duncan, Here are the complete benchmarks rerun against gcc 4.5.4 built with... Using built-in specs. COLLECT_GCC=gfortran-fsf-4.5 COLLECT_LTO_WRAPPER=/sw/lib/gcc4.5/libexec/gcc/x86_64-apple-darwin11.0.0/4.5.4/lto-wrapper Target: x86_64-apple-darwin11.0.0 Configured with: ../gcc-4.5.4/configure --prefix=/sw --prefix=/sw/lib/gcc4.5 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.5/info
2011 Jun 18
1
Vim-R-Plugin issue : Python interface must be enabled to run Vim-R-Plugin
I am trying to get the Vim-R-Plugin<http://www.vim.org/scripts/script.php?script_id=2628> to work with gvim and R on Windows 7. When I open a .R file in VIM, it complains and says ""Python interface must be enabled to run Vim-R-Plugin." I have installed pywin32 for python 2.7, and added the following 4 lines to my _vimrc per the instructions
2013 May 29
0
[LLVMdev] Polyhedron 2005 results for dragonegg 3.3svn
On Wed, May 29, 2013 at 03:25:30PM +0200, Duncan Sands wrote: > Hi Jack, I pulled the loop vectorizer and fast math changes into the 3.3 branch, > so hopefully they will be part of 3.3 rc3 (and 3.3 final!). It would be great > if you could redo the benchmarks rc3. > Duncan, As requested, appended are the updated Polyhedron 2005 benchmark results with both RC1 and RC3 llvm 3.3
2007 Aug 22
5
Slow concurrent actions on the same LVM logical volume
Hi 2 all ! I have problems with concurrent filesystem actions on a ocfs2 filesystem which is mounted by 2 nodes. OS=RH5ES and OCFS2=1.2.6 F.e.: If I have a LV called testlv which is mounted on /mnt on both servers and I do a "dd if=/dev/zero of=/mnt/test.a bs=1024 count=1000000" on server 1 and do at the same time a du -hs /mnt/test.a it takes about 5 seconds for du -hs to execute: 270M
2010 Dec 09
1
Extremely poor write performance, but read appears to be okay
Hello, I'm writing from the otherside of the world from where my systems are, so details are coming in slow. We have a 6TB OCFS2 volume across 20 or so nodes all running OEL5.4 running ocfs2-1.4.4. The system has worked fairly well for the last 6-8 months. Something has happened over the last few weeks which has driven write performance nearly to a halt. I'm not sure how to proceed, and