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.
summarize
874
questions
1
vote
1
answer
28
views
PowerBI line chart by month
I want to create a line chart that summarizes a percentage by month. The table has a column of type Date like 7/11/24 and a column of No/Yes to compute the percentage of Yes's out of the total.
...
0
votes
0
answers
24
views
R, summarize dataframe based on certain columns and put 1 column values into list [duplicate]
I have a large dataframe and I need to summarize based on 3 columns (source, source_detail, information) and values in column year will be put into list, like in Table 2.
My first code is
data %>% ...
0
votes
1
answer
32
views
R summarise with optional columns
I create a lot of columns via summarize and delete columns that I don't need in a second step. Another option would be to create each column separately and then join them using join, which is probably ...
1
vote
0
answers
229
views
ImportError: Using `bitsandbytes` 8-bit quantization requires Accelerate
I encountered an error when downloading a model from huggingface. It was working on Google Colab, but not working on my windows machine. I am using Python 3.10.0.
The error code is shown below:
E:\...
0
votes
1
answer
41
views
How do I get the total number of tests performed based on ID and date range with R?
My data looks like this. Some people may have up to 48 observations spread over 4 years. I'm looking to get specific totals based on date ranges.
Name <- c("Doe, John","Doe, John&...
0
votes
1
answer
26
views
How to preserve the correct values in a date-column when using summarize() from dplyr?
I am using summarize() to transform one dataframe (cid_term) to another one (row_1dyadep). I want to receive one row for each value of a grouping variable (new_dyadep_id). For many of the variables, I ...
1
vote
3
answers
60
views
R dplyr summarise over intervals
This is probably an R dplyr summarise question.
I have a data.frame with values recorded for subjects at 5 minute time intervals and it has these three columns: id: subject ID, value: the recorded ...
0
votes
1
answer
24
views
Why does the order of functions within summarise() affect its output?
When I use two functions within dplyr::summarise(), the ordering of the functions affects the output. While this post shows this can happen when the first function affects the columns the second ...
0
votes
1
answer
88
views
R summarise by group, then build avg. based on condition
I have to create a table that shows average values of each variable DT06_1-DT06_19 (caution: I only have variables DT06_1-DT06_3, DT06_7, DT06_10-DT06_19.
The averages shall be computed by group. I ...
1
vote
3
answers
44
views
Using current value inside of a conditional summarise in dplyr
I am quite new to dplyr and can't figure what I am doing wrong.
I have the following dataset:
INSTRUMENT_USED Year UniqueCount
1 QUEST_A 2015 1
2 QUEST_A 2016 1
...
0
votes
1
answer
50
views
Issue with using n_distinct in sparklyr to count distinct values based on condition
I'm encountering an issue while trying to count the number of distinct values in a Spark DataFrame column based on a condition using sparklyr. Here's the code I'm using:
library(sparklyr)
library(...
0
votes
1
answer
52
views
dplyr summarize sum values greater than a threshold by group
I have a dataframe with ~64,000 rows that is structured as
df <- data.frame(FY = c(2018, 2018, 2019, 2019, 2020, 2020), WorkArea = c("03218", "03219", "07589", "...
0
votes
3
answers
77
views
How to use the "summarise" function in R to calculate the product of values in two columns? [closed]
In the orders_joined dataframe, I need to calculate the total revenue based on my sales and price by multiplying them together. And then I need to assign them to a new object - total_revenue.
I need ...
2
votes
2
answers
80
views
Combine (summarize) certain rows based on a category
I'm working with a simple dataframe in R, similar to this one:
data <- data.frame(
"food"= c("Banana", "Orange", "Apple", "Meat", "Fish"...
0
votes
0
answers
25
views
Use GROUPBY measure in Power BI
I have a table that lists different chracteristics in funtion of the distance. At each position, there is either a vlue or not, and often the only a part of the values are filled.
I want to 'summarize'...