Questions tagged [group-summaries]

69 questions
0
votes
1 answer

Summary of multiple columns

Need help with the summarise and group function on the dataset below The goal is to get a sum of all non blanks against the column with header "name" Sample of data using dput below structure(list(Name = c("CICS_TEL_6_PP Nov2019", "CICS_TEL_6_PP…
Iqbal S
  • 1
  • 2
0
votes
3 answers

R - After grouping, how do I get the maximum times a value is repeated?

Say I have a dataset like this: id <- c(1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3) foo <- c('a', 'b', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'a', 'a') dat <- data.frame(id, foo) I.e., id foo 1 1 a 2 1 b 3 2 a 4 2 a 5 2 b 6 2 …
Jacob Curtis
  • 788
  • 1
  • 8
  • 22
0
votes
4 answers

Aggregate by multiple columns and reshape from long to wide

There are some questions similar to this topic on SO but not exactly like my usecase. I have a dataset where the columns are laid out as shown below Id Description Value 10 Cat 19 10 Cat …
bison2178
  • 747
  • 1
  • 8
  • 22
0
votes
0 answers

Apply round to functions used in summarise_at

I'd like to calculate multiple summary stats for several variables, and would like to round the output values to 2 digits. Here is a simplified dataset FA1 = c(0.68, 0.79, 0.65, 0.72, 0.79, 0.78, 0.77, 0.67, 0.77, 0.7) FA2 = c(0.08, 0.12, 0.07,…
heatherr
  • 143
  • 12
0
votes
1 answer

Insert new observation by group that is a sum(or weighted sum) in r

i am still new to R and many things are still hard to execute. The community here has been very helpful! I have yet another problem. 1. Creating a new observation for each group that would be the sum(or weighted sum) of certain variables 2. Creating…
T.Z
  • 65
  • 7
0
votes
2 answers

Conditional and grouped summaries by week dplyr

Complicating a previous question, lets say I have the following sock data. >socks year drawer week sock_total 1990 1 1 3 1990 1 2 4 1990 1 3 3 1990 1 4 2 1990 1 5…
Alex
  • 2,603
  • 4
  • 40
  • 73
0
votes
2 answers

How to summarize rows and columns in R?

I have this kind of table: aaa bbb ccc A 0 3 5 B 2 2 2 C 2 5 7 I get it using anti_join (for a table with non numeric values) and table command to group the…
Ale
  • 645
  • 4
  • 16
  • 38
0
votes
1 answer

R - group data frame from a variable

I want to set the column for grouping a data frame into a variable and then group and summarise the data frame based on it, i.e. require(dplyr) var <- colnames(mtcars)[10] summaries <- mtcars %>% dplyr::group_by(var) %>%…
Stefano
  • 361
  • 1
  • 4
  • 21
0
votes
2 answers

summarize data with two functions in dplyr

Considering this example dataframe: d <- read.table(text=" trt rep y 1 1 30 1 1 50 1 1 70 1 2 0 1 2 0 1 2 0 2 1 10 2 1 0 2 1 0 2 2 5 2 2 0 2 2…
Juanchi
  • 1,147
  • 2
  • 18
  • 36
0
votes
0 answers

Summary calculations from multiple tables in CR

I'm working on crystal reports and have a humdinger of a problem with summaries - I have a batch of data which has three levels of summaries: "ordinv_rec"."activity" "ordinv_rec"."op_region_2" "ordinv_rec"."operator" this is my query: SELECT…
0
votes
1 answer

SSRS Display list of distinct values and totals from another column for those values

This seems like something that should be so very simple and easy but I'm completely missing it. I've got a set of transactions I'm trying to report on. Each has a set of data that I'm displaying grouped by a business date. Two parts of this are card…
0
votes
1 answer

R dplyr Summarising based condition

I have a data set of items downloaded from a website based on reports we generate. The idea is to remove reports that are no longer needed based on the number of downloads. The logic is basically count all the reports for the last year that have…
John Smith
  • 2,448
  • 7
  • 54
  • 78
0
votes
1 answer

Combining columns of a table based on age range

I have a table in R that looks like (below is just a sample): | | 15 | 17 | 18 | 22 | 25 | 26 | 27 | 29 | |-------|----|----|----|----|----|----|----|----| | 10000 | 1 | 2 | 1 | 2 | 4 | 3 | 5 | 2 | | 20000 | 0 | 0 | 0 | 0 | 0 | 0…
Dhruv Ghulati
  • 2,976
  • 3
  • 35
  • 51
0
votes
1 answer

finding percentage frequency of outcomes over groups in R

I have a very large data frame, representing time series data from an agent-based model, that looks like this: Each row in this dataset represents a single cycle of the model, which can run for an arbitrary length of time and terminate in one of…
Steve Palley
  • 325
  • 1
  • 3
  • 11
0
votes
1 answer

Summarize data by a subset of grouping variable

I would like too summarize one column by another, which I know how to do, using either ddply or aggregate...But, I want to also add groups within my grouping variable to summarize the data in a custom fashion, see below: ##Create…
ctlamb
  • 131
  • 1
  • 4
  • 14