Questions tagged [summarize]

A dplyr instruction ( actually named summarise( ) ) to create a new data frame by grouping data according to given grouping variables. Use this tag along with the dplyr version being used. Mind the spelling in the method name.

summarise() creates a new data frame. It will have one (or more) rows for each combination of grouping variables; if there are no grouping variables, the output will have a single row (or more, as of 1.0.0) summarising all observations in the input. It will contain one column for each grouping variable and one column for each of the summary statistics that you have specified.

836 questions
0
votes
2 answers

excel dynamically summarize a text matrix?

So not sure quite what I'm asking here, but seeing if you could give me pointers? Let's say I've got a planning table like this below. I'm trying to think of a way to have a second table that will list each ToolID and a single cell that shows all…
surfer349
  • 107
  • 3
  • 10
0
votes
1 answer

Javascript - convert string to associative array and summarize by value

This is the first time I am working with javascript. I have the following…
Mooni
  • 121
  • 12
0
votes
1 answer

Aggregating while concatenating in R using dplyr piping

How do I group and summarise a dataframe from DF1 to DF4? I want to spread the data in such a way that my strings are concatenated. I am able to get to DF3 using Example: DF1 <- data.frame(Owner = c("Owner A","Owner B","Owner C","Owner B","Owner…
val
  • 1,629
  • 1
  • 30
  • 56
0
votes
4 answers

Adding column values as long as a value in other column matches

How do I add column values as long as a value in the other column is the same? e.g. from the following list: Time Value 10 a 20 b 10 c 10 d 20 f I want to obtain the following result: Time Value 10 …
0
votes
1 answer

dynamic aggregation by category in R

I have the following dataframe a <- c(rep("CGR", 6), rep("AUS", 6), rep("ROW", 6) ) b <- c("AUT", "CH", "ROW", "ROW", "ROW", "ROW", "AUT", "CH", "ROW", "ROW", "ROW", "ROW", "AUT", "CH", "ROW", "ROW", "ROW", "ROW" ) v <-…
msh855
  • 1,493
  • 1
  • 15
  • 36
0
votes
1 answer

summarise divide two columns as percent

I'm having trouble finding what percent of Canada geese get killed during migration season using the Airplane Strikes data set. #airline stats table airlines <- sd4 %>% group_by(STATE) %>% filter(SPECIES == "Canada goose" & total_kills > 1) %>%…
zabada
  • 67
  • 1
  • 10
0
votes
3 answers

dplyr summarize grouped data with another column

I have a data frame pop.subset <-: state location pop WA Seattle 100 WA Kent 20 OR foo 30 CA foo2 80 I need the city in each state with the lowest population stored in a data.frame. I have: result <-…
sushi
  • 274
  • 1
  • 4
  • 13
0
votes
1 answer

R - Summarize data.frame on an interval

I am trying to sum a variable on a data.frame for every Friday. Random data frame mydf = data.frame( "ID" = c( rep( "A" , 6) , rep( "B" , 5 ) ), "Date" = c(…
mathnoob
  • 73
  • 1
  • 1
  • 9
0
votes
1 answer

Summarise species occurence data as plot abundance data

I have a 3-column table with plots, species and occurrences. I would like to summarise the data in that individual occurrences are grouped by species within plots. I have tried the following code: aggregate(occurrence ~ species, AbundTGLMSOn,…
tabtimm
  • 411
  • 3
  • 6
  • 17
0
votes
1 answer

DAX Query Tabular: How to use SUMMARIZE Function with FILTER Function, which have different columns on both functions

We are Using SELECTCOLUMNS Function for providing Alais Name, SUMMARIZE function for Aggregating the Data, also we are using FILTER function to filter data in the same query. Requirement : We want to perform Aggregation on Some other Columns…
0
votes
1 answer

r aggregate and collapse several cells into one

I have a data frame: x <- data.frame(id = 1:18, super = c(rep("A", 12), rep("B", 6)), category = c(rep("one", 6), rep("two", 6), rep("three", 6)), root = sort(rep(letters[1:6], 3)), …
user3245256
  • 1,842
  • 4
  • 24
  • 51
0
votes
1 answer

Summarise_each and dplyr syntax

I've been given a set of particularly messy data. In it there were three columns denoting the same factor variable - focus1, focus2, and focus3 where each observation of the data could contain more than one focus yet they are not a measure of…
MokeEire
  • 638
  • 1
  • 8
  • 19
0
votes
2 answers

Unable to apply ddply-summarise in R correctly

new here and new to R, so bear with me, please. I have a data.frame similar to this: time. variable TEER 1 0.07 cntrl 234.2795 2 1.07 cntrl 602.8245 3 2.07 cntrl 703.6844 4 3.07 cntrl 699.4538 ... 48 0.07 cntrl …
0
votes
0 answers

difference between last row and row meeting condition dplyr

This is probably easy, but in a grouped data frame, I'm trying to find the difference in diff.column between the last row and the row where var.col is B The condition only appears once within each group. I'd like to make that difference a new…
tlyons253
  • 83
  • 8