0

I have a set of data for movie revenue, with the corresponding year and producer. I need to find a way to subset the movies released in a specific decade for a specific producer.

I created a table that shows the year and Publishers for the whole data set, but I need to specify the publisher and a set decade to find the amount of movies release by x publisher in x decade.

Heres what I tried

table(TxSales$Year, TxSales$Producer)

This gives me the number of movies released by each producer in each year from 1978 to 1996 (Omits 20 rows due, maxed space)

jdab
  • 3
  • 2
  • Convert your years to decades. See e.g. [Floor a year to the decade in R](https://stackoverflow.com/questions/35352914/floor-a-year-to-the-decade-in-r). And if you want just one producer then filter your data before creating the table. For more help I would suggest to provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data. – stefan Nov 15 '22 at 07:14
  • Greetings! Usually it is helpful to provide a minimally reproducible dataset for questions here so people can troubleshoot your problems (rather than a table or screenshot for example). One way of doing this is by using the `dput` function. You can find out how to use it here: https://youtu.be/3EID3P1oisg – Shawn Hemelstrand Nov 16 '22 at 06:46

0 Answers0