Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Aggregation In R

I’m new to R. Please forgive me if this an easy one.

But I’m attempting to aggregate fields in a data table. However, I’m not get the correct result in the chart that is rendered.

At first glance, can anyone see a problem with my script?

# PLOT Bar Char
p <- plot_ly(
type = ‘bar’,
orientation = ‘v’,
x = dataset$xlabQ1,
transforms = list(
list(
type = ‘aggregate’,
groups = dataset$xlabQ1,
aggregations = list(
list(
target = ‘y’, func = ‘count’, enabled = T
)
)
)
)
)
p

Hi @isr

Looks like you’re missing the y value (y = ...). You can compare against Plotly’s example here https://plot.ly/r/aggregations/#basic-example