<font color="#663333"><font size="2"><font face="verdana,sans-serif">Dear list members,</font></font></font><div><font color="#663333"><font size="2"><font face="verdana,sans-serif"><br></font></font></font></div><div><font color="#663333"><font size="2"><font face="verdana,sans-serif">I have just read a thread (</font></font></font><span class="Apple-style-span" style="color: rgb(102, 51, 51); font-family: verdana, sans-serif; "><a href="http://lists.r-forge.r-project.org/pipermail/roxygen-devel/2009-August/000077.html">http://lists.r-forge.r-project.org/pipermail/roxygen-devel/2009-August/000077.html</a>)</span><span class="Apple-style-span" style="color: rgb(102, 51, 51); font-family: verdana, sans-serif; "> from a year ago about "problem with backslashes" with roxygen, after I was searching for an asnwere for my problem.</span></div>
<div><span class="Apple-style-span" style="color: rgb(102, 51, 51); font-family: verdana, sans-serif; ">I have some functions with default parameter set to '\n', e.g.:</span></div><div><span class="Apple-style-span" style="color: rgb(102, 51, 51); font-family: verdana, sans-serif; "><div>
<br></div><div> lineCount <- function(text, sep='\n') {</div><div> ...</div><div> }</div></span></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><font class="Apple-style-span" face="verdana, sans-serif"><br>
</font></div><div><font color="#663333"><font size="2">Which purpose is to count new line ('\n') characters in a string.</font></font></div><div><font color="#663333"><font size="2">The problem is that R CMD check gives a warning about:</font></font></div>
<div><font color="#663333"><font size="2"><br></font></font></div><div><font color="#663333"><font size="2"><div>Codoc mismatches from documentation object 'lineCount':</div><div>lineCount</div><div> Code: function(text, sep = "\n")</div>
<div> Docs: function(text, sep = " ")</div><div> Mismatches in argument default values:</div><div> Name: 'sep' Code: "\n" Docs: " "</div><div><br></div><div>The problem seems to me that caused by writing to the Rd file (writing to standard LaTeX files always requires to double escape characters for some purpose, e.g.: \\newline - as I experienced).</div>
<div>If I put an extra backslash to the separator, like:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><div><span class="Apple-style-span" style="color: rgb(102, 51, 51); font-family: verdana, sans-serif; "><div>
lineCount <- function(text, sep='\\n') {</div><div> ...</div><div> }</div><div><br></div><div>The problem still presists, as in the code it looks like '\\n', but in the docs it looks '\n'.</div>
<div>Is there an easy solution for my problem? May be an extra tag in Roxygen which could define how to write the function's params to the Rd file?</div><div>Sorry if asked too obvious question, but I am lost after google-ing for a while.</div>
<div><br></div><div>Best regards,</div><div>Gergely Daróczi</div></span></div></span></div></font></font></div>