I have a dataframe structured like this

```
path                   clicks
/a/b/index.html         1000
/a/b/index.html#1        500
/a/index.html#1          250

```

R Code:

```
path <- c('/a/b/index.html','/a/b/index.html#1','/a/index.html#1')
clicks <- c(1000, 500, 250)
d.f <- data.frame(path,clicks)

```

The first two rows are basically the same URL path. **Hence, I would like to merge these two rows into one by path adding clicks and reducing the path name of the result to simply '#1' while getting rid of the old names.** The result would look something like this:

```
path               clicks
#1                  1500
/a/index.html#1      250

```

From what I read this can be achieved by using `aggregate()`, but I can't quiet find a decent introduction thoroughly explaining how this function works.

Anyways, I'd be thankful if you could either provide me with a solution or point me to a beginner-friendly source to educate myself with the relevant material.