similar to: trouble with summary tables with several variables using aggregate function

Displaying 20 results from an estimated 20000 matches similar to: "trouble with summary tables with several variables using aggregate function"

2005 May 29
2
"text"-function: adding text in an x,y-plot
Hello R-friends, i have a question to the "text"-function. a little test-dataset for better understanding: -the dataset was imported with read.table(....,header=TRUE) s1-s10 are the samplenames var1 var2 var3 s1 1 1 2 s2 2 3 1 s3 2 2 3 s4 5 4 3 s5 4 2 3 s6 6 3 2 s7 8 5 4 s8 7 2 1 s9 9 3 2
2008 Oct 10
1
Correlation among correlation matrices cor() - Interpretation
Hello, If I have two correlation matrices (e.g. one for each of two treatments) and then perform cor() on those two correlation matrices is this third correlation matrix interpreted as the correlation between the two treatments? In my sample below I would interpret that the treatments are 0.28 correlated. Is this correct? > var1<- c(.000000000008, .09, .1234, .5670008, .00110011002200,
2010 Feb 17
2
Is the aggregate function the best way to do this?
Hi, I''m having a dataframe ''Subset1'' with a number of factor variables and 160 numerical variables Now I want to make sums for all rows that have the same values for the different factor variables, except for the factor variables: VAR1,VAR2,VAR3 who may have the same values. With the formula given below this works great, but in a situation with 15000 rows and 13
2009 Sep 22
3
converting a character vector to a function's input
Hi all, I have been trying to solve this problem and have had no luck so far. I have numeric vectors VAR1, VAR2, and VAR3 which I am trying to cbind. I also have a character vector "VAR1,VAR2,VAR3". How do I manipulate this character vector such that I can input a transformed version of the character vector into cbind and have it recognize that I'm trying to refer to my numeric
2004 Aug 17
5
Bug in colnames of data.frames?
Hi, I am using R 1.9.1 on on i686 PC with SuSE Linux 9.0. I have a data.frame, e.g.: > myData <- data.frame( var1 = c( 1:4 ), var2 = c (5:8 ) ) If I add a new column by > myData$var3 <- myData[ , "var1" ] + myData[ , "var2" ] everything is fine, but if I omit the commas: > myData$var4 <- myData[ "var1" ] + myData[ "var2" ] the name
2014 Aug 21
2
pregunta
Buenas noches Javier y José, Estoy en contra de usar attach(), asi que propongo la siguiente alternativa con with(): # paquete require(epicalc) # los argumentos en ... pasan de epicalc:::cc # ver ?cc para mas informacion foo <- function(var1, var2, var3, ...){ or1 <- cc(var1, var2, ...) or2 <- cc(var1, var3, ...) list(or1 = or1, or2 = or2) } # datos x <-
2012 Jul 01
2
list to dataframe conversion-testing for identical
HI R help, I was trying to get identical data frame from a list using two methods. #Suppose my list is: listdat1<-list(rnorm(10,20),rep(LETTERS[1:2],5),rep(1:5,2)) #Creating dataframe using cbind dat1<-data.frame(do.call("cbind",listdat1)) colnames(dat1)<-c("Var1","Var2","Var3") #Second dataframe conversion
2006 Jan 13
2
find mean of a list of timeseries
Can someone please give me a clue how to 're'write this so I dont need to use loops. a<-ts(matrix(c(1,1,1,10,10,10,20,20,20),nrow=3),names=c('var1','var2','var3')) b<-ts(matrix(c(2,2,2,11,11,11,21,21,21),nrow=3),names=c('var1','var2','var3'))
2014 Aug 21
2
pregunta
Estimados Estoy entrenando hacer funciones que respondan a comandos, en esta caso en la salida gráfica se observa que dice : Exposure=var3 y outcome=var 1 quisiéramos que se reflejan los nombres de la base de datos : var1=estado, var2=cake, var3=chocolate Espero haberme explicado adecuadamente Adjunto tabla con datos #################################### #Comando que llama
2014 Apr 11
6
crear variable en base a nombre de columnas que tienen un 1
Buenos días. Hoy ando un poco (o bastante) espeso y no doy con la tecla de una cosa que seguro que es muy simple.. Pongo un ejemplo. var1 <- c(rep(0,3),rep(1,2)) var2 <- c(rep(1,2),0,0,1) var3 <- c(rep(1,2),rep(0,3)) var4 <- c(rep(1,2),rep(0,3)) datos <- data.frame(fila=1:5,var1, var2, var3, var4) datos datos fila var1 var2 var3 var4 1 1 0 1 1 1 2 2 0
2013 Mar 25
2
Faster way of summing values up based on expand.grid
Hello! # I have 3 vectors of values: values1<-rnorm(10) values2<-rnorm(10) values3<-rnorm(10) # In real life, all 3 vectors have a length of 25 # I create all possible combinations of 4 based on 10 elements: mycombos<-expand.grid(1:10,1:10,1:10,1:10) dim(mycombos) # Removing rows that contain pairs of identical values in any 2 of these columns: mycombos<-mycombos[!(mycombos$Var1
2014 Apr 11
2
crear variable en base a nombre de columnas que tienen un 1
Carlos, en principio si sería algo así, sólo que en vez de quedarme con todas las columnas var1 a var4 tuviera sólo 3, ya que en mis datos no hay ningún caso que tenga el valor 1 en más de 3 variables.. Había llegado a una solución (mucho menos elegante que usando reshape), que implicaba un for sobre las filas. Jorge, creo que tu solución me vale. Muchas gracias a los dos.. Saludos El
2011 Jan 23
3
FUNC_ODBC and ARRAY
Gentlemen, I have googled, searched the mailing list archives, and even spoke on the IRC channel, but have not found an answer to the following problem. I am attempting to retrieve multiple columns in an ODBC query using ARRAY per the solutions offered by many individuals. My dialplan code is as follows: exten => _.,n,Set(ARRAY(var1,var2,var3)=${ODBC_LOOKUP(${KEYVAL})}) exten =>
2010 Jun 18
3
inverse function of melt
Dear list, I'm looking for an inverse function of melt(which is in package reshape).Namely, I had a data frame like this (Table1) YEAR VAR1 VAR2 VAR3 1995 7 3 45 1996 5 6 32 1997 6 10 15 I transformed my data by using the melt function and my data was reshaped in the following format: (Table2) YEAR variable
2009 Sep 01
2
Simple question about data.frame reduction
Hi, this is a simple question I have this data.frame: > test <- data.frame(var1=c(1,1,1,1,1,1),var2=c("a","a","b","c","d","e"),var3=c("a1","a1","b1","a1","c1","d1")) > test var1 var2 var3 1 1 a a1 2 1 a a1 3 1 b b1 4 1 c a1 5 1
2008 Mar 19
4
plot with diffrent colour and plotting symbols
Dear mailing list members, I am a new R user, I would like to plot the follewing data var1 <- c(1,2,1,1,2,1,2,1,2,2) var2 <- round(rgamma(10,2,1)/0.1)*0.1 var3 <- c(0,1,0,1,0,0,0,0,1,0) var4 <- c(1,2,2,2,1,1,1,1,1,1) Var <- data.frame(var1,var2,var3,var4) Var <- Var[sort(Var$var1),] tt <- Var$var1+((runif(length(Var$var1))/6)-(0.5/6)) labelname <- c("time 1",
2009 Nov 25
1
Sampling dataframe
Hi, I have a table like that: > datatest var1 var2 var3 1 1 1 1 2 3 1 2 3 8 1 3 4 6 1 4 5 10 1 5 6 2 2 1 7 4 2 2 8 6 2 3 9 8 2 4 10 10 2 5 I need to create another table based on that with the rules: take a random sample by var2==1 (2 sample rows for example): var1 var2 var3 1 1
2008 Aug 07
2
List of "occurrence" matrices
R users, I don't know if I can make myself clear but I'll give it a try. I have a data.frame like this x <- "var1,var2,var3,var4 a,b,b,a b,b,c,b c,a,a,a a,b,c,c b,a,c,a c,c,b,b a,c,a,b b,c,a,c c,a,b,c" DF <- read.table(textConnection(x), header=T, sep=",") DF and I would like to sum all the combinations/occurences by a factor (letter in this case) between
2016 Apr 28
0
Antwort: RE: Interdependencies of variable types, logical expressions and NA
Hi your initial ds > str(ds) 'data.frame': 2 obs. of 3 variables: $ var1: num 1 1 $ var2: logi TRUE FALSE $ var3: logi NA NA first result > str(ds) 'data.frame': 2 obs. of 6 variables: $ var1 : num 1 1 $ var2 : logi TRUE FALSE $ var3 : logi NA NA $ value_and_logical: logi TRUE TRUE $ logical_and_na : logi TRUE NA
2010 May 05
3
concatenate values of two columns
Dear list, I'm trying to concatenate the values of two columns but im not able to do it: i have a dataframe with the following two columns: X VAR1 VAR2 1 2 2 1 3 2 4 3 5 4 6 4 what i would like to