Question: When i try to use AngularJs with SemanticUI.js, the console says 

> 
> Uncaught ReferenceError : jQuery is not defined
> 
> 
> 

Here is my example of implementation :

```
<html>
<head>
<!-- I'm head of the document -->
</head>
<body>

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/angular.min.js"></script>
<script src="assets/js/semantic.min.js"></script>

<!-- My own script place right here -->

</body>
</html>

```

Am i doing the right way? I've tried to swap the script position, but my code still doesn't work.

I think the problem in the semantic.min.js, maybe the $ has been replaced by angular or something that i don't know, because when i try to remove the semantic.min.js, no one appears in the console.

I have also try another solution that i've found in stackoverflow, but yes, it still not works.

Only additional information :

```
AngularJs version 1.5.5
JQuery version 2.2.4
Semantic version 2.1.8

```

Can anyone give me a solution?

Answer: 
This seems pretty straightforward: just use `sum()`, don't mess around with `lag()` ...

Get data:

```
df<- read.table(header=TRUE,
text="
ID  DRUG  FED  DVID  CONC
1    1     1    1     20
1    1     1    2     40
2    2     0    1     30
2    2     0    2     100
")

```

Process:

```
library(dplyr)
df %>% 
  group_by(ID,DRUG,FED) %>% 
  summarise(SumConc=sum(CONC))

##      ID  DRUG   FED SumConc
## 1     1     1     1      60
## 2     2     2     0     130

```
A simple Base R approach would be using `aggregate` 

```
aggregate(CONC ~ ID + DRUG + FED, df, sum)

#  ID DRUG FED CONC
#1  2    2   0  130   
#2  1    1   1   60

```