Not sure if this will help but you can structure you script like this (Assuming you're pointing to R correctly):
index=_internal| r "getdim<-function(input){ return(aggregate(input[,'log_level'],by=list(input[,'log_level']),length))}; output=data.frame(getdim(input))"
Click "Visualization" tab to see bar chart of counts for Windows 7 _internal index. might need some ;'s to deploy in a dashboard.
... View more