0

enter image description here

I was asked to write code to find the proportions of females and males in each year of a data set but the code turned out to be wrong.

freq.table = table(olympicData$Sex, olympicData$Year)
Total = rowSums(freq.table)
Freq = freq.table/Total`
Adam Quek
  • 6,973
  • 1
  • 17
  • 23
Demo12
  • 11
  • 2
  • 1
    Please show some of your data – Chris Ruehlemann Jun 02 '22 at 09:36
  • If you are new in SO, you should have a look to: https://stackoverflow.com/help/minimal-reproducible-example#:~:text=%20How%20to%20create%20a%20Minimal%2C%20Reproducible%20Example,tell%20other%20readers%20what%20the%20expected...%20More%20 – RobertoT Jun 02 '22 at 10:07
  • I added a picture of the summary of the data. – Demo12 Jun 02 '22 at 10:23
  • Pictures are useless. Some (small amount) of ACTUAL data. – John Garland Jun 02 '22 at 10:47
  • Hi, please see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example to help you make reproducible example. You can start with `head(dput(olympicData))` and copy/paste the console output in your question. – Paul Jun 02 '22 at 12:06
  • You should share the data structure and the error message to let us know what is going on... For example, I do not know if that "`" character at the end of the code is not just typo when you typed the code here... From the information you provided, that could be considered one cause... – hamagust Jun 02 '22 at 14:34

0 Answers0