Displaying 20 results from an estimated 5000 matches similar to: "an integration question"
2011 Oct 04
1
a question about sort and BH
Hi,
I have two questions want to ask.
1. If I have a matrix like this, and I want to figure out the rows whose
value in the 3rd column are less than 0.05. How can I do it with R.
hsa-let-7a--MBTD1 0.528239197 2.41E-05
hsa-let-7a--APOBEC1 0.507869409 5.51E-05
hsa-let-7a--PAPOLA 0.470451884 0.000221774
hsa-let-7a--NF2 0.469280186 0.000231065
hsa-let-7a--SLC17A5
2008 Jul 04
2
create a zero matrix & fill
Dear R user,
I have written a function which returns max,min and variation of a power
(see below)
Power is a given matrix(1,n)
I call the function
>Variation<-VAR(p,(n-deltat))
Now the problem is when I want plot(Results[1],Results[2]). Not possible!
I become the following error (in english it means: Error in
as.double.default(x) :Object cannot be transformed in double)
>
2003 Jan 31
2
minor error in documentation of pmax in base (PR#2513)
The documentation says, "pmax and pmin take several vectors as
arguments and return a single vector giving the parallel maxima
(or minima) of the vectors."
I discovered that, if you use a matrix or array instead of a
vector, pmax returns a matrix or array, respectively.
This makes pmax and pmin much more useful, and should not be left
to people to discover on their own!
For example:
2015 Mar 25
2
[LLVMdev] Optimization puzzle...
Hi everyone,
I am wondering what¹s stopping the LLVM optimizer (opt -O3) from
eliminating the apparently useless « icmp sgt » instruction in the
following piece of LLVM IR.
> ; ModuleID = 'lambda-opt.bc'
> target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
> target triple = "x86_64-apple-macosx10.10.0"
>
> ; Function
2012 Oct 30
4
There is pmin and pmax each taking na.rm, how about psum?
Hi,
Please consider the following :
x = c(1,3,NA,5)
y = c(2,NA,4,1)
min(x,y,na.rm=TRUE) # ok
[1] 1
max(x,y,na.rm=TRUE) # ok
[1] 5
sum(x,y,na.rm=TRUE) # ok
[1] 16
pmin(x,y,na.rm=TRUE) # ok
[1] 1 3 4 1
pmax(x,y,na.rm=TRUE) # ok
[1] 2 3 4 5
psum(x,y,na.rm=TRUE)
[1] 3 3 4 6 # expected result
Error: could not find function "psum" # actual result
2010 Mar 29
1
Suggestion: Adding quick rowMin and rowMax functions to base package
Hi,
I wonder whether similarly to the very quick rowSums and colSums
functions in the base package, one could add quick functions that
calculate the min or max over rows / cols in a matrix. While
apply(x,1,min) works, I found out by profiling a program of mine that it
is rather slow for matrices with a very large number of rows. A quick
functionality seems to be already there in the
2015 Dec 24
2
override pmin/pmax for my own matrix
Hello,
I'm trying to override pmin and pmax for my own matrix. These two
functions have ... as an argument. I tried to override them as
follows:
setMethod("pmax", class_name, function(x, ..., na.rm) { ... })
I use this way to override primitive functions such as min/max and it
works fine.
But it doesn't work for pmin and pmax. I guess because they are
regular functions?
How
2015 Mar 25
3
[LLVMdev] Optimization puzzle...
Here's a version that doesn't try to do block deletion on it's own. If you
use -adce then -simplifycfg, you get what you want.
It passes all tests except one, which is that we delete an invoke of a pure
function, IE Transforms/ADCE/dce_pure_invoke.ll -
I'm not sure why that's bad.
The reason we delete it is because it returns false to
I.mayHaveSideEffects(), and in particular,
2008 Jul 04
1
initialize a matrix
Dear R users,
I'm trying to write a function which returns minimum,maximum,mean of a
vector(power)
I've done the following :
VAR<-function(power,length){
for(i in tml:length)){
tvar[i]<-i
pmean[i]<-mean(power[i:i+deltat])
pmin[i]<-min(power[i:i+deltat])
pmax[i]<-max(power[i:i+deltat])
varmax[i]<-100*(pmax[i]-pmean[i])/pmean[i]
2008 May 13
2
array dimension changes with assignment
Why does the assignment of a 3178x93 object to
another 3178x93 object remove the dimension attribute?
> GT <- array(dim = c(6,nrow(InData),ncol(InSNPs)))
> dim(GT)
[1] 6 3178 93
> SNP1 <- InSNPs[InData[,"C1"],]
> dim(SNP1)
[1] 3178 93
> SNP2 <- InSNPs[InData[,"C2"],]
> dim(SNP2)
[1] 3178 93
> dim(pmin(SNP1,SNP2))
[1] 3178 93
2004 Dec 22
2
outer(-x, x, pmin) cannot allocate
R> x <- 0. + 1:8000
R> y <- outer(-x, x, pmin)
Error: cannot allocate vector of size 1000000 Kb
Why does R need to allocate a gigabyte to create an 8000 x 8000 matrix?
It doesn't have any trouble with outer(-x, x, "+"). Thanks.
-- David Brahm (brahm at alum.mit.edu)
Version:
platform = i686-pc-linux-gnu
arch = i686
os = linux-gnu
system = i686, linux-gnu
status =
2011 Jul 04
1
Contrastes con el paquete survey (svycontrast)
Estimados usuarios:
Estoy intentando reproducir el ejemplo 6.4 de Thomas Lumley. Complex
Survey. Editorial Wiley. 2010 (ver la página en google:
2008 Apr 27
1
parallel max, min, and median of dataframe columns
Hello, all,
I have a dataframe of three rows and umpteen columns. I want to show the
maximum, minimum, and median with a vertical line and a central dot (I'd
use a boxplot, but with only three data points, that's overkill; I can't
just use points, because of overlap and some of the other data plotted on
the graph).
This works:
> boxplot(data_frame,
2010 Sep 21
5
Combined plot: Scatter + density plot
Hi,
in order to save space for a publication, it would be nice to have a
combined scatter and density plot similar to what is shows on
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=78
I wonder if anybody perhaps has already developed code for this and is
willing to share. This is the reproducible code for the histogram
version obtained from the site:
def.par <-
2003 Jul 10
1
The question is on Symmetry model for square table.
Please help,
I tried a program on S-plus, and it worked. Also I tried the same
program on R but not worked. Here is the programme. I put it in a
function form. The model and assumption are at the bottom.
where
counts<-c(22,2,2,0,5,7,14,0,0,2,36,0,0,1,17,10)
which is name.data, i is row size and j is the column size.
symmetry
function(i, j, name.data)
{
row <- (c(1:i))
col <-
2010 Feb 12
2
for loop function output
Hello all,
I am trying to run a simulation. the simulation presented below.
> rep=5
> sr=.10 # selection ratio
> pmin=.10 # minority ratio
> nap=1000 # total number of applicant
> nsle=sr*nap # number of ee selected
> nb=nap*pmin # number of minority
> nw=nap-nb # number of majority
> mb=100 # mean minority
> sb=15 # sd minority
> mw=100 # mean majority
> sw=15 #
2008 Jun 17
2
R error using Survr function with gcmrec
Would someone be able to help with this question? I'm using the
Gcmrec, Survrec, and Design packages to do a power analysis on
simulated data. I'm receiving an error after using the Survr function
that all data must have a censoring time even after using the gcmrec
function: newdata<-addCenTime(olddata). My program is below. I'd
greatly appreciate any help!
2010 Jul 07
2
What does `_data` mean in transform()?
Hi All,
I meant to take the min row by row. But the result is apparently not
what I want. Changing min to pmin solve the problem.
> df=data.frame(X=1:10, Y=1:10)
> transform(df, Z=min(X,10-Y))
X Y Z
1 1 1 0
2 2 2 0
3 3 3 0
4 4 4 0
5 5 5 0
6 6 6 0
7 7 7 0
8 8 8 0
9 9 9 0
10 10 10 0
I try to look at the source code to understand what transform() does.
I know
2005 Jan 21
4
which.pmin?
I have two vectors (k.floor and k.ceiling) of integers of the same
length, and a function (fpr).
b <- 10:40
k.floor <- floor(log(2) * b)
k.ceiling <- ceiling(log(2) * b)
fpr.floor <- fpr(b, k.floor)
fpr.ceiling <- fpr(b, k.ceiling)
If R had a element-wise ternary function, I'd like to do something like
this:
(fpr.floor < fpr.ceiling) ? k.floor :
2008 Aug 02
1
problem with nested loop for regression
Hi everyone,
I'm experiencing difficulty getting the results I want when I use a nested
for loop. I have a data set to which I perform some calculations, and then
try to apply a regression over a rolling window. The code runs, but the
regression results I am getting (intercept and slope) are simply the same,
repeated again and again in the results matrix. The regression does not seem
to be