title: Creating package for Mac in Windows / Linux
body: <p>I have trying hard to make a r package myself. I followed the instruction in previous question in stackoverflow on <a href="http://cran.r-project.org/bin/windows/Rtools/" rel="nofollow">how to develop package for layman</a>.  Here are the steps I tool following the previous question. </p>
  
  <ol>
  <li><p>Run R code in fresh R session</p>
  
  <pre><code># random DNA function
  randDNA = function(n){
  paste(sample(c("A", "C", "T", "G"), n, replace = TRUE), collapse = "")
  }
  # DNA to RNA function
  dna2rna &lt;- function(inputStr) {
    if (!is.character(inputStr))
      stop("need character input")
    is = toupper(inputStr)
    chartr("T", "U", is)
  }
  
  # complementary sequence function
  compSeq &lt;-  function(inputStr){
   chartr("ACTG", "TGAC", inputStr)
   }
  
  # example data
  dnaseq1 &lt;- c("ATTGTATCTGGGTATTTCCCTTAATTGGGGCCTTT")
  dnaseq2 &lt;- c("TGGGGTAAACCCGGTTTAAAATATATATATTTTT")
  myseqdata &lt;- data.frame(dnaseq1, dnaseq2)
  save(myseqdata, file = "myseqdata.RData")
  </code></pre></li>
  <li><p>Install <a href="http://cran.r-project.org/bin/windows/Rtools/" rel="nofollow">Rtools</a> Install R package <a href="http://cran.r-project.org/web/packages/R.utils/index.html" rel="nofollow">utils</a> </p></li>
  <li><p>Pefrom the following task in R </p>
  
  <pre><code>require(utils)
  package.skeleton(list = c("randDNA","dna2rna", "compSeq", "myseqdata"), 
  name = "dnatool",environment = .GlobalEnv, path = "c:", force = FALSE)
  </code></pre></li>
  <li><p>Edit system environment variable path to following in windows 7</p>
  
  <pre><code>C:\Rtools\bin;C:\Rtools\perl\bin;C:\Rtools\MinGW\bin; 
  C:\Program Files\R\R-2.14.2\bin\x64; 
  </code></pre>
  
  <p>(type <code>&gt;path</code> in command line to check if the path is properly set.</p></li>
  <li><p>Copy the folder dnatool in step (3) and put in new folder named rpackage, Now change directory to this folder (in DOS)</p>
  
  <pre><code>c: \ repackage&gt;  R CMD build dnatool 
  c: \ repackage&gt;  Rcmd build dnatool 
  </code></pre>
  
  <p><strong>Edit: I am sometime getting dnatool.zip but other times dnatool.tar.gx</strong></p></li>
  <li><p>Checking package in command line (DOS) </p>
  
  <pre><code>c: \ repackage&gt; R CMD check dnatool
  </code></pre></li>
  </ol>
  
  <p>I was able to pack it as "dnatool.zip" in windows.</p>
  
  <p>How can compile for MAC or unix source ? What steps are different ? </p>
  
  <pre><code>Unix source:     dnatool.tar.gz
  Mac OS X binary: dnatool.tgz
  </code></pre>
  
  <p>Do I need Mac computer to do. I do have linux virtualbox and installed ubuntu in it ? </p>
  
  <p>Edit:</p>
  
  <p>Should I use the following commad to get sourcode binary from step (3) folder dnatool ?</p>
  
  <pre><code>$ tar -zcvf dnatool.tar.gz/home/dnatool
  </code></pre>