Questions tagged [group-summaries]
69 questions
11
votes
2 answers
ASPxGridView Group Summary Sorting - It sorts the content inside, not the summary outside
I have done grouping of the grid by giving groupindex to a particular column in aspxgridview.
For example, if I am grouping by means of persons name and the orders details made by that particular person would come in the detailed content when the…

Ruchi
- 1,238
- 11
- 32
9
votes
2 answers
Parallel wilcox.test using group_by and summarise
There must be an R-ly way to call wilcox.test over multiple observations in parallel using group_by. I've spent a good deal of time reading up on this but still can't figure out a call to wilcox.test that does the job. Example data and code below,…

curious lab rat
- 93
- 1
- 5
8
votes
1 answer
dplyr summarise over nested group_by
I have a data frame like this:
Date Amount Category
1 02.07.15 1 1
2 02.07.15 2 1
3 02.07.15 3 1
4 02.07.15 4 2
5 03.07.15 5 2
6 04.07.15 6 3
7 05.07.15 7 …

Georg Heiler
- 16,916
- 36
- 162
- 292
7
votes
4 answers
Taking column mean over a list of data frames in R
Here's what I'm trying to do. My data frame has a factor variable, "country", and I want to split the data frame based on country. Then, I want to take the column mean over every variable for every country's data frame.
Data here:…

Anshu Chen
- 423
- 2
- 9
- 23
6
votes
2 answers
data.table: Using with=False and transforming function/summary function?
I want to summarise several variables in data.table, output in wide format, output possibly as a list per variable. Since several other approaches did not work, I tried to do an outer lapply, giving the names of the variables as character vectors. I…

Julian
- 741
- 8
- 19
5
votes
1 answer
Efficient way of simultaneously deriving count of unique values and summary values for grouped values in dplyr
I'm interested in finding an efficient manner to obtain a summary by group table that would contain:
Count for unique values per group
A primitive set of descriptive statistics for selected variables
For example, in case of generating the…

Konrad
- 17,740
- 16
- 106
- 167
4
votes
4 answers
Combine rows in data frame without grouping
tibble::tibble(
col1 = c("A","","C","",""),
col2 = c("string1 part 1","string1 part 2",
"string2 part 1", "string2 part 2",
"string3"),
col3 = c(1, "", 2, "", 3)
)
I'd like to merge the rows in col2, obtaining a tibble…

Thomas
- 1,252
- 6
- 24
4
votes
2 answers
R programming data frame - returning value based on position
I was wondering if there was a way to pull out a value based on position in a vector, so for example I have a data frame with two Vectors, I have them grouped from the raw by V1 and them by V2, much like a ORDER BY in SQL. My problem arises when I…

antimuon
- 252
- 2
- 12
3
votes
2 answers
compress / summarize string start and length data in R
I have a data.frame of (sub)string positions within a larger string. The data contains the start of a (sub)string and it's length. The end position of the (sub)string can be easily calculated.
data1 <- data.frame(start = c(1,3,4,9,10,13),
…

TimTeaFan
- 17,549
- 4
- 18
- 39
3
votes
3 answers
Calculate skew and kurtosis by year in R
I have a table that looks like this:
start_table <- data.frame("Water_Year" = c("1903", "1903", "1904", "1904"), "X" = c(13, 11, 12,
15), "Day" = c(1, 2, 1, 2))
(The 'Day' column is not involved in my skew & kurtosis calculation, it is just in my…

Sarah
- 411
- 4
- 14
3
votes
1 answer
How to fix the error "'x' and 'w' must have the same length" in summarise_all()?
I want to use dplyr::summarise_all() and weighted.mean to calculate the weighted averages of many columns for each group.
I tried to directly use anonymous function, but it returned an error:
'x' and 'w' must have the same length. I know I can use…

zqin
- 95
- 10
3
votes
2 answers
How to group a dataframe and summarize over subgroups of consecutive numbers in Python?
I have a dataframe with a column containing ids and other column containing numbers:
df1 = {'ID':[400, 400, 400, 400, 400, 400, 500, 500, 500, 500],
'Number':[1, 2, 3, 4, 8, 9, 22, 23, 26, 27]}
You may note that each Id has their…

Facundo Iannello
- 47
- 4
3
votes
2 answers
Summarize with dplyr "other then" groups
I need to summarize in a grouped data_frame (warn: a solution with dplyr is very much appreciated but isn't mandatory) both something on each group (simple) and the same something on "other" groups.
minimal example
if(!require(pacman))…

Corrado
- 625
- 6
- 12
3
votes
3 answers
Match and summarize dataframe in R
I have a dataframe with timeseries data columns and start year and end year.
df = data.frame(y2000=c(12,636),y2001=c(234, 76),y2002=c(3434, 46),y2003=c(36,35),y2004=c(6, 64), y2005=c(56,65), y2006=c(43,65), y2007=c( 6, 56),y2008=c( 64,…

Arihant
- 589
- 9
- 24
3
votes
1 answer
custom summerType in xtraGrid gridControl
How can add a custom summerType in xtraGrid gridControl?
I would like to add a SummerItem to a column in my xtraGrid gridControl named total percent whitch will calculate the percentage of the two other columns.
In total I have 3 columns
1.…

A. Zalonis
- 1,599
- 6
- 26
- 41