We are R-Ladies Profile picture
Sep 15 โ€ข 10 tweets โ€ข 8 min read
๐Ÿ‘ฉ๐Ÿผโ€๐Ÿ’ป How do you use GitHub and RStudio?

If you connect your local repository with a remote repository (for instance on GitHub), youโ€™ll be able to store it also in the cloud and access it from everywhere. Setting up this connection is easy in @rstudio - just follow these steps: Visualization showing a typical workflow when using GitHub i
@rstudio You can see one detailed use case in the GIF. It shows how I typically set up a project in #rstats with GitHub when working in academia

@AcademicChatter #AcademicTwitter
@rstudio @AcademicChatter I create a #GitHub repository first (depending on data privacy and other things, I go for either public or private but I always add a README. READMEs are great because they allow you write a short description of your repository in #markdown)
@rstudio @AcademicChatter Then I go back to my RStudio desktop version and select "File" > "New project". To enable version control, select here "Version control" and then copy-paste the link from your GitHub repository ๐Ÿ‘‡ Screenshot showing a green "Code" button on GitHub
@rstudio @AcademicChatter A new project opens and your version control is up and running ๐ŸŽ‰
@rstudio @AcademicChatter I realized that I usually start with a similar setup when working on an academic project, so I wrote a few code snippets that populate my #Rproject with files and folders ๐Ÿช„ # Set up the folder structure folder_names <- (     # Main f
@rstudio @AcademicChatter You can either always copy-paste this code or turn it into a code snippet that lets you run it automatically when typing "academic" (or whatever you word) and hitting "Tab".
@rstudio @AcademicChatter Here's how it works with a header (but it can be transferred to other use cases)
๐Ÿ‘‡

@rstudio @AcademicChatter I tweaked it quite a bit over the years and I'm always trying to improve things - so please share if you have a different approach or other preferred setups that work well for you ๐Ÿค“
@rstudio @AcademicChatter ๐Ÿ“‘ If you want more detailed insight into how to get the most out of a (semi)automatic setup of your workflow (including the code), hereโ€™s a short blog post I wrote about it: bit.ly/r-project-setup

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with We are R-Ladies

We are R-Ladies Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @WeAreRLadies

Sep 15
Today's about version control and collaboration today and one of its powerful tools: #git โœจ
๐Ÿ’กWhat is Git?

Using Git can be a lifesaver (and it has often been one in the past for me ๐Ÿ™). Itโ€™s basically like a mini time travel machine that you use - it allows you to have version control of your work progress.
But unlike Dropbox or other tools, it does not automatically save the status quo of your work but requires you to do it actively with commits and pushes. A typical workflow looks like this ๐Ÿ‘‡ Image showing a git workflow from the working directory to t
Read 23 tweets
Sep 14
If today inspired you and you want to write your #rstats package now, there are plenty of great resources out there!

Several #rladies talked about how to set up your package within no time ๐Ÿ’ซ

๐Ÿ“บ @RLadiesBergen: (by @srharacha)
Read 7 tweets
Sep 14
In the last thread, I described in brief how to set up your #rstats package - but as you have already seen, a package contains a bit more than just your function(s) โœจ

When building your R package, you can luckily rely on the work of others who provide an excellent framework to get you started (and also take care of some of the things in the background).
I found it difficult to understand "what" I really need and "why" when I started writing my first package. So here's a short list with what I believe are among the most helpful tools out there:
Read 15 tweets
Sep 14
Now that you know how a general package structure looks like, we can start building a package ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿ’ป
#RStudio is great, just follow these steps: Select "File", "New Project...", "New Directory" and select "R Package". You can now give your R package a meaningful name, select a path and hit "Create project". Showing RStudio wizard when creating a new package
You're now ready to go! Once executed, you have a fully functional package structure in your #Rproject (that we already discussed) ๐Ÿ˜Š Now it's time to move your function to your "R/" folder and populate it! Showing how the RStudio desktop version looks like with a ty
Read 8 tweets
Sep 14
Now let's start talking ๐Ÿ“ฆ

Writing a package sounds big -and it can for sure be. But in its simplest form, itโ€™s not that much more than putting a function in a package structure. The #rstats community is great and came up with multiple great helpers that make your life easier!
๐Ÿ’ก Whatโ€™s in an R package?

Simply speaking, an R package allows you to put functions in a box and make them available for others to use.
Ideally, your R package also comes with unit tests that make sure that your package works (or if it doesn't throw meaningful errors and let you dive into the functions and explore why it doesn't) and it adheres to the common standards of developing a package.
Read 12 tweets
Sep 14
Before we get into ๐Ÿ“ฆ development, I wanted to share my favorite shortcuts in the RStudio IDE with you. There are so many out there (bit.ly/rstudio-shortcโ€ฆ) but these are the ones that I regularly use when changing something directly in my code ๐Ÿ˜Š #rstats
I love them because they usually make your life easier. The first one allows you to add a new R code chunk in your Rmd/Quarto file using "Option + Cmd + I" on a Mac (or "Ctrl + Alt + I"). And this is exactly what the GIF shows:
The next one makes writing a type operator so much simpler! At first, it feels a bit like looking for the keys but once you have it inherited, you probably won't want to go back ๐Ÿ˜Š So instead of typing "%>%" you can now use "Cmd + Shift + M" on a Mac (or "Ctrl + Shift + M")
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(