title: How convert contingency tables (counts) to individuals for GLM in R
body: <p>I have my info as in this photograph:</p>
  <p><a href="https://i.stack.imgur.com/Co35R.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Co35R.jpg" alt="enter image description here" /></a></p>
  <p>You can download it here: <a href="https://drive.google.com/file/d/1pgO51NXtjpVSz-VxQEDNFFuQXVc4jVkt/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1pgO51NXtjpVSz-VxQEDNFFuQXVc4jVkt/view?usp=sharing</a></p>
  <p>What i want is to transform this data to individuals,</p>
  <h1>For example</h1>
  <p><a href="https://i.stack.imgur.com/KFkdr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KFkdr.png" alt="enter image description here" /></a></p>
  <p>Will transform into this</p>
  <p><a href="https://i.stack.imgur.com/qpwa9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qpwa9.png" alt="enter image description here" /></a></p>
  <h1>Another example</h1>
  <p><a href="https://i.stack.imgur.com/ER8Wq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ER8Wq.png" alt="enter image description here" /></a></p>
  <p>will turn into this</p>
  <p><a href="https://i.stack.imgur.com/y12OT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y12OT.png" alt="enter image description here" /></a></p>
  <p>So, if we say that n=&quot;sum of all numbers in the original data.frame&quot;, i.e., the number of all individuals, the final output will be a <code>data.frame</code> with 6 columns and n rows.</p>
  <p>I want to do this in R but i don't have any idea how. Once I have this, what i want to do is apply a generalized linear model with family binomial and link = probit.</p>
  <p>Now, this page can explain some of what I tried to do:</p>
  <p><a href="https://www.datanalytics.com/libro_r/la-funcion-melt-y-datos-en-formato-largo.html" rel="nofollow noreferrer">https://www.datanalytics.com/libro_r/la-funcion-melt-y-datos-en-formato-largo.html</a></p>