<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Iegor Rudnytskyi on Medium]]></title>
        <description><![CDATA[Stories by Iegor Rudnytskyi on Medium]]></description>
        <link>https://medium.com/@irudnyts?source=rss-e378889175e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*J3wMjvUrSqJBJBuu.</url>
            <title>Stories by Iegor Rudnytskyi on Medium</title>
            <link>https://medium.com/@irudnyts?source=rss-e378889175e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:15:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@irudnyts/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[pkgspell: Spell Checker for R Package Development]]></title>
            <link>https://medium.com/@irudnyts/pkgspell-spell-checker-for-r-package-development-1ef249fa50c5?source=rss-e378889175e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ef249fa50c5</guid>
            <category><![CDATA[rstats]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Iegor Rudnytskyi]]></dc:creator>
            <pubDate>Mon, 11 Apr 2016 19:25:56 GMT</pubDate>
            <atom:updated>2016-04-11T19:25:56.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*-GXWkFuJz-HvutwxucPCwQ.jpeg" /></figure><h4>Intro</h4><p>As most people I really can easily get annoyed whenever I see misspells or wrong grammar. Especially if it was done by myself :). At the same time I hate to waste my most productive and inspiring time on checking each word in google, losing focus from the content. In my case it is mainly concerns writing a documentation for packages.</p><h4>Open Possibilities</h4><p>Two months ago finishing my second package, I realized that all my packages contain plenty of typos. Moreover, according to <a href="http://r-pkgs.had.co.nz/release.html">Hadley’s book</a> (and CRAN policy) CARN requires the <em>Title</em> and the <em>Description</em> sections in DESCRIPTION file to be without spelling errors. What’s about the rest documentation? From perfectionist view, if a share of the object is perfect, then the rest should be perfect as well. Of course, as a perfectionist, I procrastinated to check the whole package for typos, giving priority to other “important” tasks. Why? Because it was time-consuming repeated manual work of checking each .R file in /R directory. Surely, one can argue, that it is possible to go through all .Rd files, and click on this beautiful button in RStudio highlighted below, and then change all typos. However, these .Rd files are generated from source files, and once you execute <strong>devtools::document()</strong> all your changes will be overwritten and lost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*hhCekCgG8Ur9DypEQJHJHw.png" /></figure><h4>First Steps</h4><p>One March morning I saw a <a href="http://www.r-bloggers.com/hunspell-spell-checker-and-text-parser-for-r/">post</a> in R-bloggers about the <a href="https://cran.r-project.org/web/packages/hunspell/index.html"><strong>hunspell</strong></a> package. For my best knowledge, there have been no ways before, how easily check the file for typos. Great! Now I can write a nice wrapper to go through all necessary files in a package, and it is done. First, I wrote a simple function, tailored for my particular package. But it is not the way, how good nerds behave. Thus, I spent my free Sunday (and some time in the hospital’s queue) to write a simple package for checking package’s documentation on fly. It is really simple, just execute <strong>pkgspell::check_pkg()</strong>, setting before your working directory to the package root folder, and you receive the list of “bad” words with respective location. The feature I proud of: instead of returning the location of error in .Rd file, the package returns the “approximate” location in .R file, which generates this error.</p><h4>Installation</h4><pre># install.packages(&quot;devtools&quot;)<br># library(devtools)<br>devtools::install_github(repo = &quot;irudnyts/pkgspell&quot;)</pre><h4>Use</h4><pre># library(pkgspell)<br>pkgspell::check_pkg(&quot;/path_to_the_root_dir_of_the_package&quot;)</pre><h4>Next steps</h4><p>Current issues, which would be great to implement/fix in next versions:</p><ul><li>It is possible for the package, to return other sections of the roxygen2 comments, that contain a misspell.</li><li>Such keywords, as <strong>emph</strong>, etc. are in the list of typos. There is a need to create a constant of tags, or an argument of ignored words list.</li><li>This package does not support custom sections in .Rd files. There is a need to implement this feature firstly in imported <a href="https://cran.r-project.org/web/packages/Rd2roxygen/index.html"><strong>Rd2roxygen</strong></a> package by Yihui (thank you for your responses to my mails).</li></ul><p>Feedback, suggestions, ideas for improvement and extensions are more than welcome, as well as any founded errors or typos :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ef249fa50c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>