similar to: Averaging within a range of values

Displaying 20 results from an estimated 10000 matches similar to: "Averaging within a range of values"

2008 Jun 15
2
How to take the average of multiple rows
Dear all, I have a matrix, called newdata1, > dim(newdata1) [1] 34176 83 It looks like: EntrezID Name S1 S2 S3 S4 S5..... 1 4076 CAPRIN1 0.1 0.2 0.3... 2 139170 WDR40B 0.4 0.5 0.6... 3 5505 PPP1R2P1 0.3 0.3 0.7... 4 4076 CAPRIN1 0.7 0.3 0.2... 5 139170 WDR40B null 0.8
2006 Jun 25
1
Puzzled with contour()
Folks, The contour() function wants x and y to be in increasing order. I have a situation where I have a grid in x and y, and associated z values, which looks like this: x y z [1,] 0.00 20 1.000 [2,] 0.00 30 1.000 [3,] 0.00 40 1.000 [4,] 0.00 50 1.000 [5,] 0.00 60 1.000 [6,] 0.00 70 1.000 [7,] 0.00 80 0.000 [8,] 0.00 90
2013 Aug 24
1
Divide the data into sub data on a particular condition
Hi, Use ?split() #dat1 is the dataset: lst1<- split(dat1,dat1$BaseProd) lst1 #$`2231` ?# BaseProd? CF OSA #1???? 2231 0.5 0.7 #2???? 2231 0.8 0.6 #3???? 2231 0.4 0.8 # #$`2232` ?# BaseProd CF OSA #4???? 2232? 1?? 2 #5???? 2232? 3?? 1 # #$`2233` ?# BaseProd? CF OSA #6???? 2233 0.9 0.5 #7???? 2233 0.7 0.5 #8???? 2233 4.0 5.0 #9???? 2233 5.0 7.0 lst1[[1]] #? BaseProd? CF OSA #1???? 2231 0.5 0.7
2003 Jul 14
6
bug?
Dear R programmers, is there a sensible explanation for the following behaviour? The second command seems not to be interpreted correctly. > seq(0.6, 0.9, by=0.1) == 0.8 [1] FALSE FALSE TRUE FALSE > seq(0.7, 0.9, by=0.1) == 0.8 [1] FALSE FALSE FALSE > c(0.7, 0.8, 0.9) == 0.8 [1] FALSE TRUE FALSE > seq(0.9, 0.7, by=-0.1) == 0.8 [1] FALSE TRUE FALSE I am running R version 1.7.1 on
2012 Nov 30
4
qbinom
a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) cor(a,b)= -1 a'=qbinom(a, 1, 0.5) b'=qbinom(b, 1, 0.5) why cor(a',b') becomes -0.5 ? -- View this message in context: http://r.789695.n4.nabble.com/qbinom-tp4651460.html Sent from the R help mailing list archive at Nabble.com.
2013 Jan 15
2
grouping elements of a data frame
Hi everyone, I have a question on selecting and grouping elements of a data frame. For example: A.df<- [ a c 0.9 b x 0.8 b z 0.5 c y 0.9 c x 0.7 c z 0.6] I want to create a list of a data frame that gives me the unique values of column 1 of A.df so that i can create intersects. That is: B[a]<- [ c 0.9] B[b]<- [ x 0.8
2009 Nov 10
1
Data transformation
Dear all, I have a dataset as below: id code1 code2 p 1 4 8 0.1 1 5 7 0.9 2 1 8 0.4 2 6 2 0.2 2 4 3 0.6 3 5 6 0.7 3 7 5 0.9 I just want to rewrite it as this (vertical to horizontal): id var1 var2 var3
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
2012 Dec 20
2
How to count the nos. in a range?
Dear R forum I have a following vector of random no.s x = runif(100, 0.01, 0.99)  [1] 0.47212037 0.77867992 0.33947474 0.93369035   [5] 0.03720073 0.79307831 0.81801835 0.92710688 ................................................. I need to count the random no. falling in the range (0 - 0.10), (0.10 - 0.20), (0.20 - 0.30)..upto (0.90 - 1) Thus, I need to have a data frame as
2007 Jul 28
1
Error when using the cat function
Is the following developed in my console output a recognized bug or am I using the cat function incorrectly? Thanks, Stan > ifelse(class(data[[n]])!="factor",{print("yes")},{print("no")}) [1] "yes" [1] "yes" > ifelse(class(data[[n]])!="factor",{cat("yes")},{cat("no")}) yesError in ans[test & !nas] <-
2012 Jul 02
4
how to do a graph with tree different colors??
hi i try to do a graph of a time series which shows in red the values > -0.05, in blue the values >0.05 and in white the values between -0.05 and 0.05 for un exemple :http://www.appinsys.com/globalwarming/enso.htm thanks !!!!! denisse -- View this message in context: http://r.789695.n4.nabble.com/how-to-do-a-graph-with-tree-different-colors-tp4635206.html Sent from the R help mailing
2012 Aug 23
3
Please help....normalization by the median of some control genes
Can someone show me some code to do normalization by the median of some control genes for the example below? Many Many Thanks in advance This strategy selects a subset of genes (called ?control genes?) and makes the median of their data distribution similar across arrays. ??? ??? id1??? id2??? id3 control1??? 0.8??? 0.7??? 0.6 control2??? 0.6??? 0.2??? 0.4 probe1??? ??? 0.3??? 0.2??? 0.5
2012 Jul 06
3
estimating NA values against selected slots
Dear R Users, Could you please help me on the following issue? I have a real large yearly data set. For each year I have 365 flow values. Some of the flow values are not known and that’s why you will see NA written in those slots. I wanted to know, is there a way that I can estimate those values? I tried approx command but it seems least helpful for the kind of issue I am up against.
2006 Nov 22
3
odd behaviour of %%?
Dear R Helpers, I am trying to extract the modulus from divisions by a sequence of fractions. I noticed that %% seems to behave inconsistently (to my untutored eye), thus: > 0.1%%0.1 [1] 0 > 0.2%%0.1 [1] 0 > 0.3%%0.1 [1] 0.1 > 0.4%%0.1 [1] 0 > 0.5%%0.1 [1] 0.1 > 0.6%%0.1 [1] 0.1 > 0.7%%0.1 [1] 0.1 > 0.8%%0.1 [1] 0 > 0.9%%0.1 The modulus for 0.1, 0.2, 0.4 and 0.8 is
2006 Dec 29
3
strange logical results
Dear R People: I am getting some odd results when using logical operators: > x <- seq(from=-1,to=1,by=0.1) > > x [1] -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 [16] 0.5 0.6 0.7 0.8 0.9 1.0 > x == -1 [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE > x
2011 Nov 18
1
How to fill irregular polygons with patterns?
Hi, I'm looking the best way to fill irregular polygons with patterns, Something like the function grid.pattern do, but my case is with irregular polygons. Whit this script I can get it, but I'm looking for an "elegant" solution.. library(grid) grid.polygon(x=c(0.2, 0.8, 0.6, 0.6, 0.8, 0.2), y=c(0.2, 0.2, 0.3, 0.5, 0.7,0.7), gp=gpar(fill="grey",
2007 Oct 22
2
Help interpreting output of Rprof
Hello there, I am not quite sure how to interpret the output of Rprof (in the following the output I was staring at). I was poking around the web a little bit for documentation but without much success. I guess if I want to figure out what takes so long in my code the 2nd table $by.total and the total.pct column (pct = percent) is the most helpful. What does it mean that [ or [.data.frame is
2013 May 15
1
x and y lengths differ
I have a problem with R. I try to compute the confidence interval for my df. When I want to create the plot I have this problem: Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ. I try this code: library(dplR) df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL) write.table(df.rwi,file="rwi.txt",quote=FALSE,row.names=TRUE)
2012 Aug 18
1
Parameter scaling problems with optim and Nelder-Mead method (bug?)
Dear all, I?m having some problems getting optim with method="Nelder-Mead" to work properly. It seems like there is no way of controlling the step size, and the step size seems to depend on the *difference* between the initial values, which makes no sense. Example: f=function(xy, mu1, mu2) { print(xy) dnorm(xy[1]-mu1)*dnorm(xy[2]-mu2) } f1=function(xy) -f(xy, 0,
2010 Sep 08
11
problem with outer
Hello, i wrote this function guete and now i want to plot it: but i get this error message. i hope someone can help me. Error in dim(robj) <- c(dX, dY) : dims [product 16] do not match the length of object [1] p_11=seq(0,0.3,0.1) p_12=seq(0.1,0.4,0.1) guete = function(p_11,p_12) { set.seed(1000) S_vek=matrix(0,nrow=N,ncol=1) for(i in 1:N) { X_0=rmultinom(q-1,size=1,prob=p_0)