Code "tags"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Code "tags"

mollyolaf
Hi all,

I'm trying to get organized about my R programming and I'm looking for a
way to "tag" snippets of handy code that I go back to time and again. At
the moment, I just plop .R files into a folder and rely on the file name to
guide me. In desperation, I've taken to saving the same chunk as multiple
.R files with different "tags" (e.g. "Loops with titles.R" = "CLT
example.R").

Any tips would be appreciated.

Thanks,
Leslie

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Code "tags"

Bert Gunter-2
"get organized around R programming" is rather vague.  Nor do I know what
you mean by "tagging" code snippets.

A standard answer would be to write your "code" as documented functions in
a package (e.g. "LeslieMisc"). RStudio -- a wholly separate software
product -- has various tools to that may also be relevant. RMarkdown allows
you to write documents in which you embed executable R code, which is
useful for producing "vignettes" to illustrate how code works. Roxygen is
useful for producing package docs with a minimum of pain. Any of these --
and others, like just producing inline comments -- may be useful.

-- Bert



On Wed, Oct 10, 2018 at 12:43 PM Leslie Rutkowski <
[hidden email]> wrote:

> Hi all,
>
> I'm trying to get organized about my R programming and I'm looking for a
> way to "tag" snippets of handy code that I go back to time and again. At
> the moment, I just plop .R files into a folder and rely on the file name to
> guide me. In desperation, I've taken to saving the same chunk as multiple
> .R files with different "tags" (e.g. "Loops with titles.R" = "CLT
> example.R").
>
> Any tips would be appreciated.
>
> Thanks,
> Leslie
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Code "tags"

mollyolaf
"tags" are a way to label things digitally so that they are easier to find
later - Twitter uses these, as one example.

I found a nice solution: GitHubGist with an interface via Lepton, if anyone
else would like to avoid rummaging through old code to find something (a
function, an example, whatever). Organization looks pretty detailed and
relatively user friendly, with labels for languages and tags. You can also
make your "gists" public or private.

Leslie



On Wed, Oct 10, 2018 at 4:15 PM Bert Gunter <[hidden email]> wrote:

> "get organized around R programming" is rather vague.  Nor do I know what
> you mean by "tagging" code snippets.
>
> A standard answer would be to write your "code" as documented functions in
> a package (e.g. "LeslieMisc"). RStudio -- a wholly separate software
> product -- has various tools to that may also be relevant. RMarkdown allows
> you to write documents in which you embed executable R code, which is
> useful for producing "vignettes" to illustrate how code works. Roxygen is
> useful for producing package docs with a minimum of pain. Any of these --
> and others, like just producing inline comments -- may be useful.
>
> -- Bert
>
>
>
> On Wed, Oct 10, 2018 at 12:43 PM Leslie Rutkowski <
> [hidden email]> wrote:
>
>> Hi all,
>>
>> I'm trying to get organized about my R programming and I'm looking for a
>> way to "tag" snippets of handy code that I go back to time and again. At
>> the moment, I just plop .R files into a folder and rely on the file name
>> to
>> guide me. In desperation, I've taken to saving the same chunk as multiple
>> .R files with different "tags" (e.g. "Loops with titles.R" = "CLT
>> example.R").
>>
>> Any tips would be appreciated.
>>
>> Thanks,
>> Leslie
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Code "tags"

Jim Lemon-4
In reply to this post by mollyolaf
Hi Leslie,
Keeping track of any sort of text (or music or pictures) can be
challenging when the number of files becomes large. One way to
organize a large collection is to categorize it in some way that makes
sense to you. Say you create a directory structure:

R_code__________________________________________________
            |                      |                            |
               |                         |
data_input         output_listing        desc_stats           plots
           R objects
   |          |               |             |
                                   |              |
CSV    Excel       text        HTML
              saving   combining

Within categories like that, your filenames might be sufficient to
identify the one you want.

Jim

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.