similar to: aggregate

Displaying 20 results from an estimated 30000 matches similar to: "aggregate"

2012 Nov 14
5
aggregate combination data
Dear R users, I want to aggregate all *d *data from all combination of n *plots* taken by k. Thank very much! My data is like that: plot d 1 14 1 13 1 12 1 14 1 18 1 20 1 21 1 43 1 108 1 43 2 41 2 61 2 83 2 61 2 84 2 45 2 21 2 12 2 11 ... 100 10 100 12 -- --- Catalin-Constantin ROIBU Forestry engineer, PhD Forestry Faculty of Suceava
2010 Apr 16
4
score counts in an aggregate function
Dear R-Users, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 0 1 1 1 1 0 2 0 1 1 0 3 NA 1 1 0 4 1 0 2 1 1 0 1 2 1 2 NA 1 2 1 3 1
2011 Oct 05
2
aggregate function with a dataframe for both "x" and "by"
I have 2 dataframes. "mydata" contains numerical data. "mybys" contains information on the "group" each row of the data is in. I wish to aggregate each column in mydata using the corresponding column in mybys. Please see the example below. What is a more elegant or "better" way to accomplish this task? Thanks! mydata =
2012 Jul 03
2
Data manipulation with aggregate
Hi everyone. I have these data : myData = data.frame(Name = c('a', 'a', 'b', 'b'), length = c(1,2,3,4), type = c('x','x','y','z')) which gives me: Name length type 1 a 1 x 2 a 2 x 3 b 3 y 4 b 4 z I would group (mean) this DF using 'Name' as grouping factor. However, I have a
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'. I do this using aggregate, data.table, and plyr. My aggregate results do not match the other two, and I am trying to figure out what is incorrect with my syntax. Any suggestions? Thanks. Here is the data. myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61, 30.59, 30.84, 30.98, 30.79, 30.79,
2011 Feb 07
2
Using Aggregate for Date
Hi, I am trying to find the min of day for each student in each year. Here is the dataset: date studentid year 1/1/05 6:07 AM 236 20082009 3/27/09 9:45 AM 236 20082009 4/29/09 8:44 AM 236 20082009 3/27/09 11:36 AM 310 20082009 4/1/09 10:43 AM 310 20082009 10/15/09 8:54 AM 310
2007 Mar 07
5
how to "apply" functions to unbalanced data in long format by factors......cant get "by" or "aggregate" to work
Hello R users, Problem.......I do not understand how to use "aggregate","by", or the appropriate "apply" to perform a function on data with more than one factor on unbalanced data... I have a data frame in the long format that does not contain balanced data. The ID is a unique identifier corresponding to the experimental unit that will later be examined by ANOVA,
2016 Apr 15
0
aggregate combination data
Hello, I'm cc'ing R-Help. Sorry but your question was asked 3.5 years ago, I really don't remember it. Can you please post a question to R-Help, with a reproducible example that describes your problem? Rui Barradas ? Citando catalin roibu <catalinroibu at gmail.com>: > Dear Rui, > ? > I helped me some time ago with a code..... regarding aggregated data >
2011 Jul 14
2
cbind in aggregate formula - based on an existing object (vector)
Hello! I am aggregating using a formula in aggregate - of the type: aggregate(cbind(var1,var2,var3)~factor1+factor2,sum,data=mydata) However, I actually have an object (vector of my variables to be aggregated): myvars<-c("var1","var2","var3") I'd like my aggregate formula (its "cbind" part) to be able to use my "myvars" object. Is it
2008 Jun 04
2
Question about subsetting data
I have a data set(Bill) of with 1 variable (var1), with 100 obs that are in ascending order. I want to sample every 10 observations and save them in 10 different groups such as Group1 is obs 1-10 Group 2 is obs-11-20 and so on. First step is to subset them into the 10 groups, then calculate the mean of var1 for each of the 10 groups. Any help would be appreciated. Thanks.
2012 Jan 01
1
How to pass in a list of variables as an argument to a function?
Hello, I have some code that currently works fine and I am endeavoring to convert the major pieces of it into functions. This involves taking "hard coded" names of variables that are used in various places and figuring out how to abstract them out into functions where the arguments (i.e. a list of variables)?can be passed to the parent function and used within that function for various
2010 Jan 29
1
apply function with grouped columns
I have a data set of many rows and many columns in which both the rows and the columns have associated grouping factors. Is there a way to do what 'aggregate' does but in the other dimension? The way I have been doing this is to use 'aggregate' on the data in the usual way and then rotate the result and apply 'aggregate' again. This works but is a little messy and I was
2008 Oct 21
3
code works in R desktop but not iin RWeb - How do I modify to get it working in RWeb, please?
Hi, How are you? I have a quick question.... I have code that works perfectly with R desktop, but does not work with RWeb. Could you please tell me how to modify the code below so it will work with RWeb? #Read in txt file happyguys<-read.table("c:/test8.txt", header=TRUE, row.names=1) #Subset the txt file to only include certain values test<-subset(happyguys, GRADE == 7
2012 Nov 14
2
aggrete data from combination
Dear R users, A have a dataframe (matrix) with two collumns (plot, and diameter (d)). I want all diameters values for different combination of plots. For example I want all d values for all posible combination, 100C2 (all d values for plot 1 with all d values in the plot 2.......with all d values from plot 1 with all d values from plot 100, ...... with all d values from plot 99 with all d values
2009 Nov 08
2
Counting non-empty levels of a factor
Hi everyone, I'm struggling with a little problem for a while, and I'm wondering if anyone could help... I have a dataset (from retailing industry) that indicates which brands are present in a panel of 500 stores, store , brand 1 , B1 1 , B2 1 , B3 2 , B1 2 , B3 3 , B2 3 , B3 3 , B4 I would like to know how many brands are present in each store, I tried: result <-
2011 Jan 22
2
meaning of formula in aggregate function
Dear R community Recently, dear Henrique Dallazuanna literally saved me solving one problem on data transformation which follows: (n_, _n, j_, k_ signify numbers) SOURCE DATA: id cycle1 cycle2 cycle3 ? cycle_n 1 c c c c 1 m m m m 1 f f f f 2 m m m NA 2
2006 Dec 28
2
Aggregation using list with Hmisc summarize function
Hi All, I'm using the Hmisc summarize function and used list instead of llist to provide the by variables. It generated an error message. Is this a bug, or do I misunderstand how Hmisc works with lists? The program below demonstrates the error message. Thanks, Bob x<-1:8 group <- c(1,1,1,1,2,2,2,2) gender<- c(1,2,1,2,1,2,1,2) mydata<-data.frame(x,group,gender)
2010 Sep 21
2
group means of multi-way table?
hello, can someone tell me how to generate the means for a data frame that looks like this? My data frame has many more variables, but I won't bother you with those; these are the one's that I'm interested in. Needless to say, z is the variable in which I'm interested. I'd like to find out the mean score of z for NDP managers, Conservative managers and Liberal managers
2011 Dec 06
1
Problem with clusplot
Dear all I'm trying to run a cluster analysis with R Here are the commands: mydata <- na.omit(matrix) # listwise deletion of missing mydata <- scale(matrix) # standardize variables fit <- kmeans(mydata, 8) # 8 cluster solution # get cluster means aggregate(mydata,by=list(fit$cluster),FUN=mean) # append cluster assignment mydata <- data.frame(mydata, fit$cluster)
2007 Oct 30
1
NAIVE BAYES with 10-fold cross validation
hi there!! i am trying to implement the code of the e1071 package for naive bayes, but it doens't really work, any ideas?? i am very glad about any help!! i need a naive bayes with 10-fold cross validation: code: library(e1071) model <- naiveBayes(code ~ ., mydata) tune.control <- tune.control(random = FALSE, nrepeat = 1, repeat.aggregate = min, sampling = c("cross"),