0

I would like to set the number of occurrences of the count(Category) to automatically replace the 155. The df is continually expanding and want my code to read the number of occurrences (which it is doing) then output so I do not have to manually change the 155.

df %>% 
  filter(dfCategory !='N/A', !is.na(dfCategory)) %>%  #filter your data
  count(Category)

#cat is

cat <- isolate(input$selectCategory)

Grant is one of the different values in the Category column of my df

if(cat == 'Grant'){
 holidays <- head(coorespondingCSV, 155 + hrzn)
 }
camille
  • 16,432
  • 18
  • 38
  • 60
  • 2
    [See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with. That includes a useable sample of data, what packages you're using, and a clear sense of what the problem is – camille Feb 22 '22 at 17:58
  • Please share a reproducible dataset using the `dput` function. Here is how: https://youtu.be/3EID3P1oisg – Shawn Hemelstrand Feb 26 '22 at 01:43

0 Answers0