[R] Renaming multiple objects

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sat Nov 20 15:57:21 CET 2021


Agreed... This Is The Way.

To interactively sit at the R console and type in commands without keeping those commands in an editor and running them from scratch periodically to insure that they achieve your goals is a only a recipe for mystery, not for data analysis.

R is a tool for transforming raw data into i interpretable forms. If you are not keeping track of how you used it, how can you convince yourself or others that you did it right? And if you are keeping track, then you should feel comfortable editing that set of transformation steps so they do the right thing the first time.

On November 20, 2021 2:53:05 AM PST, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
>On 20/11/2021 5:27 a.m., Steven Yen wrote:
>> I have named NUMEROUS objects (each containing, e.g., 48 obs. of 5
>> variables), such as
>>     mec1.p.emb
>>     mec2.p.emb
>>     meb1.p.emb
>>     meb2.p.emb
>>     mej12.p.emb
>>     mej22.p.emb
>> 
>> How would I rename these objects removing the silly ".emb", into objects
>>     mec1.p
>>     mec2.p
>>     meb1.p
>>     meb2.p
>>     mej12.p
>>     mej22.p
>> 
>
>Use a global search and replace on your source code, and create them 
>with the correct names.
>
>Duncan Murdoch
>
>______________________________________________
>R-help using r-project.org 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.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list