Displaying 20 results from an estimated 180 matches for "group_bi".
Did you mean:
group_by
2017 Sep 09
2
Avoid duplication in dplyr::summarise
Dear group,
Is there a way I could avoid the sort of duplication illustrated below?
i.e., I have the same dplyr::summarise function on different group_by
arguments. So I'd like to create a single summarise function that could be
applied to both. My attempt below fails.
df <- data.frame(matrix(rnorm(40), 10, 4),
f1 = gl(3, 10, labels = letters[1:3]),
f2 =
2017 Sep 09
0
Avoid duplication in dplyr::summarise
Hi Lars
I am not very sure what you really want. However, I am suggesting the
following code that enables (1) to obtain the full summary of your data and
(2) retrieve only mean of X values as function of factors f1 and f2.
library(tidyverse)
library(psych)
df <- data.frame(matrix(rnorm(40), 10, 4),
f1 = gl(3, 10, labels = letters[1:3]),
f2 = gl(3, 10, labels
2017 Sep 09
1
Avoid duplication in dplyr::summarise
Hi Lars,
Two comments:
1. You can achieve what you want with a slight modification of your
definition of s(), using the hint from the error message that you need an
argument '.':
s <- function(.) {
dplyr::summarise(., x1m = mean(X1),
x2m = mean(X2),
x3m = mean(X3),
x4m = mean(X4))
}
2. You have not given a great test case in
2023 Nov 03
2
Sum data according to date in sequence
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
dput(head(dt1))
colnames(dt1) <-
2012 Oct 23
0
multidimensional Array or Hash with group_by 'created_at'
Hello,
i want to create a multidimensional Array or Hash with group_by
''created_at''.
3 dimensions needed:
myArray[week][day][data]
currently i only created it with 2 dimesions:
#model
def self.group_per_day
all.group_by{|t| t.created_at.strftime("%d. %B, %Y")}.sort #"%U" for
Weeks
end
#controller
@pdf_activities = Activity.group_per_day
#view
2019 May 20
2
Agrupar por suma y cuenta con dplyr
Hola,
Tengo un data set con información de transferencias monetarias por paciente
provincia y modalidad de atención. Necesito hacer en una misma operación
una suma de dinero por provincia y modalidad y a su vez una cuenta de
pacientes por provincia y modalidad.
Esto funciona bien:
transferencias<-becas_modalidades %>%
group_by(PROVINCIA,Modalidad) %>%
summarize(dinero =
2023 Nov 03
1
Sum data according to date in sequence
Is this what you are after?
library(tidyverse)
library(lubridate)
input <- structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE
2018 Mar 22
1
Calculate weighted proportions for several factors at once
Hi,
I have a grouped data set and would like to calculate weighted proportions for a large number of factor variables within each group member. Rather than using dplyr::count() on each of these factors individually, the idea would be to do it for all factors at once. Does anyone know how this would work? Here is a reproducible example:
############################################################
2018 Feb 10
2
Optimizar función
Buenas para tod en s, tengo una consulta para poder optimizar tiempos. Ejemplo
tengo el siguiente dataframe:
distrito<-c("A","A","A","B","B","B","C","C","C","A","A","B","B","C")
2006 May 03
2
grouped output
hello,
Suppose I have a table that looks like this:
center name email
Health Jon jon@test.com
Health Bob bob@test.com
Admin Jane jan@test.com
Admin Jill jill@test.com
I would like the output to look like this:
Health
Jon jon@test.com
Bob bob@test.com
Admin
Jane jan@test.com
Jill jill@test.com
when i using cold fusion, this was easy via a tag called cfoutput.
when i was using java, this was
2008 Mar 12
3
Some random rails, and maybe Ruby, questions..
Hi,
I''m attempting to create a users statistics controller, and have saved
up some questions regarding this for this post.
So, please comment on any one of them, if not all :-)
1) Is there a library somewhere for doing stats? (e.g. mean, median,
sd, skewness..) on an array in rails?
2) What library would you recommend for "publication ready" (i.e. not
cheesy) histograms,
2019 Oct 05
5
should base R have a piping operator ?
Yes but this exageration precisely misses the point.
Concerning your examples:
* I love fread but I think it makes a lot of subjective choices that are
best associated with a package. I think it
changed a lot with time and can still change, and we have great developers
willing to maintain it and be reactive
regarding feature requests or bug reports
*.group_by() adds a class that works only (or
2020 Sep 13
3
CALCULAR SALDO DE CUENTA CORRIENTE
Pido ayuda para calcular el SALDO
*DATAFRAME:*
ASIENTO FECHA CUENTA CONCEPTO ARS_DEB ARS_HAB
SALDO
1 1 2020-01-01 40100006 Asiento de Apertura 0 199517.
-199517.
2 231 2020-01-13 40100006 15/01 CH53677071 GALICIA 14054. 0
14054.
3 231 2020-01-13 40100006 20/01 CH22406030 CREDICOO 9458. 0
23511.
4 231 2020-01-13
2009 Mar 04
10
total per user
so I am trying to sum month over month the amount that a user has
posted. So for example:
User 1: Jan $3000 Feb $4000 March $1500, etc. I can get this to work
if I sum totals (aggregate of all users) but just not by user.
Here is my code in the controller:
def index
@users = User.find :all, :order => ''name ASC''
@deal_groups = Deal.find(:all).group_by {|t|
2013 Jan 24
12
group by + sum
Hi.. I need some support...
table:
week_id, user_id, project_id, hours
ex. =>
33, 2, 1, 10
34, 2,1,15
33, 2, 2, 20
35, 3, 1,20
etc.
Want to display a sum of hours per week_id per user_id
I have:
@hours = HourUser.includes(:user).group_by { |h| h.week_id }
@hours.keys.sort.each do |hour|
@hours[hour].collect(&:stunden).sum
Hours are summed up, but not sorted by user_id..
How to get
2023 Nov 02
4
Sum data according to date in sequence
Dear all,
I have this set of data. I would like to sum the EnergykWh according date
sequences.
> head(dt1,20) StationName date time EnergykWh
1 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 12:09 4.680496
2 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 19:50 6.272414
3 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 20:22 1.032782
4 PALO ALTO CA / CAMBRIDGE #1 1/15/2016 8:25 11.004884
5
2006 Apr 09
6
Write/Display AR query as Grouped Results?
I''ve got a publications table that contains an author_id foreign key and
a pubrole_id foreign key. What I want to do is query the DB using AR so
that I can get a list of all publications that belong_to a particular
author, and group the results by the pubrole.role_name (Author, Joint
Author, Editor, etc.) so that the results look something like:
Author
book1 info
book2 info
etc.
2019 Feb 16
4
Duda error sintaxis
Buenas tardes chicos, estoy intentando hacer un gráfico que resuma para
cada dia de la semana la información de algunos distritos específicos de
los que contiene mi variable, ejecuto esta sintaxis pero me da un error
Error: Mapping should be created with `aes() or `aes_()`.
Alguien me puede orientar sobre que estoy haciendo mal, llevo mucho rato
atascada.
Muchas gracias
df_nuevofinal %>%
2016 May 12
2
Division entre el numero de ocurrencias parciales y totales dentro de un DataFrame de manera eficiente
Hola:
A ver si me podéis ayudar que estoy atascado...
Necesito contar los subcasos de la columna 2 de un dataframe respecto a los
casos de la columna 1.
Es decir, tengo un data.frame
a<-c(rep(c('a','b','c','b','c'),3),'b')
b<-c(rep(c('x','y','z','w'),4))
c<-c(rep(c(1,1,0,0),4))
2019 Jul 27
3
[PATCH libnbd] lib: Use symbol versions.
This patch adds support for symbol versions. It is based on what
libvirt does.
The generated syms file looks like:
LIBNBD_1.0 {
global:
nbd_...;
nbd_...;
local: *;
};
In a future stable 1.2 release, new symbols would go into a new
section which would look like this:
LIBNBD_1.2 {
global:
nbd_new_symbol;
nbd_another_new_symbol;
local: *;
} LIBNBD_1.0;
In my testing the