similar to: Help to select the raw in a data.frame with the max value

Displaying 20 results from an estimated 10000 matches similar to: "Help to select the raw in a data.frame with the max value"

2008 Nov 04
2
merge 2 txt file
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081104/11b51aba/attachment.pl>
2008 Jul 30
3
Random subset
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080730/c69d6903/attachment.pl>
2011 Apr 07
1
df with max function applied to 6 lags of a variable?!?
Hello everyone! I have a data frame of 136 variables with 270 observations. I would like to create a new data frame such that each element of that data frame contains the maximum value of the 6 prior lags of the initial data frame. So for example, if my original data frame, A, were A1=c(7.72, 7.94, 7.56, 7.54, 0.93, 0.59, 7.21, 8.00, 7.19, 7.57)A2=c(4.27, 3.70, 3.80, 3.67, 3.83, 3.95, 4.02, 2.06,
2009 Oct 29
3
Removing & generating data by category
Dear R users, Basically, from the following arbitrary data set: a <- data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life",4))) > a
2005 Mar 19
2
simple problem, but not for me
Hello, I'm new in R and I want to do one thing that is very easy in excel, however, I cant do it in R. Suppose we have the data frame: data<- data.frame(A=c("a1","a2","a3","a4","a5")) I need to obtain another column in the same data frame (lets say B=c(b1,b2,b3,b4,b5) in the following way: b1=a1/(a1+a2+a3+a4+a5)
2017 Oct 09
3
Merge me agrega siempre las columnas
Buenas, Tengo dos data.frames de la siguiente manera library(data.table) id<-c("a1","a2","a3","a4") id2<-c("a2","a3","a1","a4") y<-c(1,2,3,4) z<-c(3,5,6,7) k<-c(1,3,8,7) df1<-data.table(id,y,z) id<-c("a2","a3","a1","a4") df2<-data.table(id,x,y) Quiero
2010 Apr 13
2
sensitivity analysis, input factors
Hi, I'm trying to conduct sensitivity analysis in R using the 'sensitivity' package. Although the description of functions seem straightforward, I can?t succeed. The definition of input factors can be the problem. library(sensitivity) #A simple model with 4 input factor to test the morris function: model01=function(a1,a2,a3,a4) { Z<-numeric(10) Z[1]<-runif(1)
2008 Feb 10
2
reshape
Dear colleagues, I'd like to reshape a datafame in a long format to a wide format, but I do not quite get what I want. Here is an example of the data I've have (dat): sp <- c("a", "a", "a", "a", "b", "b", "b", "c", "d", "d", "d", "d") tr <- c("A",
2008 Mar 25
2
Compare two data sets
I would like to compare two data sets saved as text files (example below) to determine if both sets are identical(or if dat2 is missing information that is included in dat1) and if they are not identical list what information is different between the two sets(ie output "a1", "a3" as the differing information). The overall purpose would be to remove "a1" and
2009 Sep 04
1
User defined function's argument as Subset function's input
Dear R users, I have a data where I desire to subset according to certain conditions. However, the script is very messy as there are about 30 distinct conditions. (i.e. same script but with different conditions) I would like to make a user defined function so that I can input the desired conditions and just get the results accordingly. Below is an arbitrary data set & sample statements
2018 May 27
1
if else with 4 conditions problem
Hi everyone, I have two columns: ? ?A? ? ? ? ? ? ? ?B ? ?1? ? ? ? ? ? ? ?1? ?1? ? ? ? ? ? ? ?0 ? ?0? ? ? ? ? ? ? ?1 ? ?0? ? ? ? ? ? ? ?0 I have 4 categories which are: 1) if A = 1 and B =1 then A1 = 1, else A2 = 0, A3 = 0, A4 = 0 2) if A = 1 and B =0 then A1 = 0, else A2 =1, A3 = 0, A4 = 0 3) if A = 0 and B = 1 then A1 = 0, else A2 = 0, A3 = 1, A4 = 0 4) if A = 0 and B =0 then A1 = 0, else A2 =
2008 Aug 08
2
import/export txt file
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080808/aa9e5eab/attachment.pl>
2010 Sep 27
2
subtraction based on two groups in a dataframe
Hello I have a data set like below: plate.id well.id Group HYB rlt1 1 P1 A1 Control SKOV3hyb 0.190 2 P1 A2 Control SKOV3hyb 0.210 3 P1 A3 Control SKOV3hyb 0.205 4 P1 A4 Control SKOV3hyb 0.206 5 P1 A5 Control SKOV3hyb 0.184 385 P1 A1 ovca SKOV3hyb 0.184 386 P1 A2 ovca SKOV3hyb 0.229 387
2013 Feb 07
1
Merging data in arrays
Dear All, Here is a hypothetical sample (sorry for the clumsy code): A1 <- matrix(1:5, nrow=5, ncol=1) A2 <- matrix(6:10, nrow=5, ncol=1) A3 <- matrix(11:15, nrow=5, ncol=1) A4 <- matrix(16:20, nrow=5, ncol=1) A5 <- matrix(21:25, nrow=5, ncol=1) A6 <- matrix(26:30, nrow=5, ncol=1) B1 <- matrix(c(A1, A2, A3), nrow=5, ncol=3) B2 <- matrix(c(A2, A3, A4), nrow=5, ncol=3) B3
2009 Jan 11
4
How to get solution of following polynomial?
Hi, I want find all roots for the following polynomial : a <- c(-0.07, 0.17); b <- c(1, -4); cc <- matrix(c(0.24, 0.00, -0.08, -0.31), 2); d <- matrix(c(0, 0, -0.13, -0.37), 2); e <- matrix(c(0.2, 0, -0.06, -0.34), 2) A1 <- diag(2) + a %*% t(b) + cc; A2 <- -cc + d; A3 <- -d + e; A4 <- -e fn <- function(z) { y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
2010 Jun 17
3
ask a question about data sets element
for example, I have a1=c(1,3,5) a2=c(2,4,6) a3=c(7,8) a4=c(9,10) now if I have i=5, so i in a1, then I get a feedback tag[5]=1 i=8, so i in a3, then can get tag[8]=3 in there any function to do this to check the element belongs to which group? thank you!!! [[alternative HTML version deleted]]
2009 Jul 29
1
Subtract matrices within arrays along indices
I have the following array: 3 dimensional object, one dimension being year. Object is 3*3*3 library(plyr, reshape) a1<-rep(c(2007,2008,2009),9) a2<-c(rep("a",9),rep("b",9),rep("c",9)) a3<-c(rep(c(rep(1,3),rep(2,3),rep(3,3)),3)) a4 <- rnorm(27) A<-data.frame(cbind(comp=a2,val=a3, year=a1, a4)) A1<-melt(A, id=c("year", "comp",
2009 Apr 09
1
HELP to cbind several data.frame with a LOOP
Dear R users, thank for help. SORRY I am seeing in google a maillist but I didn't find a solution for my problem I have several txt file (with the same number of column and HEADER) to merge together, this is an example: Tableanalysis_firenze_10.txt Tableanalysis_firenze_20.txt Tableanalysis_firenze_30.txt Tableanalysis_firenze_40.txt Tableanalysis_firenze_50.txt
2004 Sep 28
3
sapply behavior
Hi, I use sapply very frequently, but I have recently noticed a behavior of sapply which I don't understand and have never seen before. Basically, sapply returns what looks like a matrix, says it a matrix, and appears to let me do matrix things (like transpose). But it is also a list and behaves like a list when I subset it, not a vector (so I can't sort a row for instance). I
2003 Dec 17
1
TODO hardlink reporting problem - fixed?
On Mon, 15 Dec 2003, jw schultz <jw@pegasys.ws> wrote: > OK, first pass on TODO complete. .... This hardlink bug report is nearly 21 months old... So I took a look at it using 2.5.7. See below. > BUGS --------------------------------------------------------------- > > Fix hardlink reporting 2002/03/25 > (was: There seems