Q:

Trying to find the cumulative daily profits for longs and shorts of stocks

I have the code below that gives me the time series results of a stock and groups everything into 'buys' and 'sells' buckets (based on closing prices higher or lower than opening prices).
library(dplyr)
library(data.table)
library(quantmod)
library(zoo)

# enter tickers to download time-series data
e <- new.env()
getSymbols("SBUX", env = e)
pframe <- do.call(merge, as.list(e))
#head(pframe)

# get a subset of data
df = pframe$SBUX.Close

colnames(df)[1] <- "Close"
head(df)

# Assign groupings
addGrps <- transform(df,Group = ifelse(Close < lead(Close), "S", "B"))

# create subsets
buys <- addGrps[addGrps$Group == 'B',]
sells <- addGrps[addGrps$Group == 'S',]

Now, I am trying to group the results by daily profits (Diff) and losses and find the cumulative sum of each (profits and losses).
I think it should be something like this, but something is off, and I'm not sure what it is.
# find daily differences
df <- df %>%
mutate(Diff = addGrps$Close - lead(addGrps$Close))

# get up and down price movements
ups <- filter(df, Diff > 0 )
downs <- filter(df, Diff <= 0 )

# cumulative sums of longs and shorts
longs<-cumsum(ups$Diff)
shorts<-cumsum(downs$Diff)

A:

I'm not sure if I'm totally following your question/problem, and it seems like there is some unnecessary code. For example, all those packages aren't needed (at least, not yet),
and it's not clear why the two subset data frames for the buys and sells are needed. At the very least, the following cleans up some of what you've done so far, and gets the data in an easy to work with data frame. With some clarification, maybe this is a start.
library(quantmod)
library(tidyverse) # rather than just dplyr

# pull the SBUX data as a data frame and create the necessary new columns:
df <- data.frame(getSymbols(Symbols = 'SBUX', env = NULL)) %>%  # pull the raw data
  rownames_to_column('date') %>%                                # convert the row index to a column
  select(date, close = SBUX.Close) %>%                          # select only the SBUX.Close column and rename it
  mutate(group = ifelse(close < lead(close), 's', 'b')) %>%     # assign the sell or buy group
  mutate(diff = close - lead(close)) %>%                        # create the diff calculation
  mutate(movement = ifelse(diff > 0, 'up', 'down')) %>%         # create the movement classification 
  tbl_df()

# just to view the new data frame: 
df %>% head(5)
# A tibble: 5 x 5
  date       close group    diff movement
 <chr>      <dbl> <chr>   <dbl> <chr>   
1 2007-01-03  17.6 s     -0.0200 down    
2 2007-01-04  17.6 b      0.0750 up      
3 2007-01-05  17.6 b      0.0650 up      
4 2007-01-08  17.5 b      0.0750 up      
5 2007-01-09  17.4 b      0.0550 up 

# calculate the sums of the diff by the movement up or down:
df %>% 
  filter(!is.na(movement)) %>%    # this removes the last date from the data - it cannot have a lead closing price
  group_by(movement) %>%          
  summarize(cum_sum = sum(diff))
# A tibble: 2 x 2
  movement cum_sum
  <chr>      <dbl>
1 down       -489.
2 up          455.

